templateMap.put(template.getTemplateName(), template);
templateCache.put(template.getTemplateName(), template.getBodyTemplate());
templateCache.put(template.getTemplateName() + DEFAULT_SUBJECT_SUFFIX, template.getSubjectTemplate());
}
freemarkerConfiguration = new Configuration();
freemarkerConfiguration.setTemplateLoader(new TemplateLoader() {
@Override
public Object findTemplateSource(String name) throws IOException {
return templateCache.containsKey(name) ? templateCache.get(name) : null;
}