check to make sure that recipient is selected

This commit is contained in:
Emil Siverhall 2012-01-29 22:34:35 +01:00
parent 64f43d9355
commit e3ee0874f9

@ -113,14 +113,14 @@ public class AdminMailPanel extends Panel {
protected void onSubmit() {
try {
for (User u : userSet) {
System.out.println(u.getEmailAddress());
}
System.out.println(userSet.size());
//MailEvent me = new MailEvent(mailSubjectField.getInput(), mailBodyField.getInput(), userSet, fromName, fromEmail);
//me = mailEventDao.save(me);
//info("E-mail sent successfully to the selected recipients!);
if(userSet != null && !userSet.isEmpty()) {
MailEvent me = new MailEvent(mailSubjectField.getInput(), mailBodyField.getInput(), userSet, fromName, fromEmail);
me = mailEventDao.save(me);
info("E-mail sent successfully to the selected recipients");
}
else {
error("You need to specify recipients for your e-mail.");
}
} catch (Exception e) {
logger.info("Failed to send e-mail");
}