KEYCLOAK-9320 Make theme properties available in email templates

This commit is contained in:
Guilhem Lucas 2019-01-14 12:02:04 +01:00 committed by Stian Thorgersen
parent 191c9753de
commit b666756b8f

View file

@ -204,6 +204,7 @@ public class FreeMarkerEmailTemplateProvider implements EmailTemplateProvider {
attributes.put("locale", locale); attributes.put("locale", locale);
Properties rb = theme.getMessages(locale); Properties rb = theme.getMessages(locale);
attributes.put("msg", new MessageFormatterMethod(locale, rb)); attributes.put("msg", new MessageFormatterMethod(locale, rb));
attributes.put("properties", theme.getProperties());
String subject = new MessageFormat(rb.getProperty(subjectKey, subjectKey), locale).format(subjectAttributes.toArray()); String subject = new MessageFormat(rb.getProperty(subjectKey, subjectKey), locale).format(subjectAttributes.toArray());
String textTemplate = String.format("text/%s", template); String textTemplate = String.format("text/%s", template);
String textBody; String textBody;