LOGGER.debug("Message [" + name + "] is not sent because mailing is off");
return;
}
// Load template
TextTemplate textTemplate;
try {
textTemplate = textTemplateFactory.getTemplate(name, locale);
} catch (TextTemplateException e) {
throw new SystemIntegrityException("Template [" + name + "] is not found", e);
}
// Prepare model
Map<String, Object> model = ImmutableMap.<String, Object>builder()
.put("locale", locale)
.put("timezone", timezone)
.putAll(attributes)
.build();
// Render template
String text;
try {
text = textTemplate.render(model);
} catch (TextTemplateException e) {
throw new SystemIntegrityException("Template [" + name + "] could not be rendered", e);
}
// Load subject