try to fix template resolvers, step 3
This commit is contained in:
parent
e8bad4e24e
commit
5a9ccbcfc1
@ -17,6 +17,7 @@ public class MailTemplateConfiguration {
|
||||
final SpringTemplateEngine templateEngine = new SpringTemplateEngine();
|
||||
templateEngine.addTemplateResolver(templateResolver);
|
||||
templateEngine.addTemplateResolver(emailTemplateResolver());
|
||||
templateEngine.addTemplateResolver(mvcTemplateResolver());
|
||||
templateEngine.addDialect(new LayoutDialect());
|
||||
templateEngine.addDialect(sec);
|
||||
return templateEngine;
|
||||
@ -32,4 +33,14 @@ public class MailTemplateConfiguration {
|
||||
return emailTemplateResolver;
|
||||
}
|
||||
|
||||
public ClassLoaderTemplateResolver mvcTemplateResolver() {
|
||||
ClassLoaderTemplateResolver emailTemplateResolver = new ClassLoaderTemplateResolver();
|
||||
emailTemplateResolver.setPrefix("templates/");
|
||||
emailTemplateResolver.setTemplateMode("HTML5");
|
||||
emailTemplateResolver.setSuffix(".html");
|
||||
emailTemplateResolver.setOrder(2);
|
||||
emailTemplateResolver.setCharacterEncoding(StandardCharsets.UTF_8.name());
|
||||
return emailTemplateResolver;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user