model.put("recipients", recipientTOs);
model.put("syncopeConf", this.findAllSyncopeConfs());
model.put("events", notification.getEvents());
NotificationTask task = new NotificationTask();
task.setTraceLevel(notification.getTraceLevel());
task.setRecipients(recipientEmails);
task.setSender(notification.getSender());
task.setSubject(notification.getSubject());
String htmlBody = mergeTemplateIntoString(
MAIL_TEMPLATES + notification.getTemplate() + MAIL_TEMPLATE_HTML_SUFFIX, model);
String textBody = mergeTemplateIntoString(
MAIL_TEMPLATES + notification.getTemplate() + MAIL_TEMPLATE_TEXT_SUFFIX, model);
task.setHtmlBody(htmlBody);
task.setTextBody(textBody);
return task;
}