Hi
We're using mailNotifications in Broadleaf to send email when a checkout is being completed. This all works fine, as long as we're using the emailService.sendBasicEmail. From the moment on we"re trying to use the thymeleaf templates sending emails fails with the following exception:
Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Resource resolution by ServletContext with org.thymeleaf.resourceresolver.ServletContextResourceResolver can only be performed when context implements org.thymeleaf.context.IWebContext [current context: org.thymeleaf.context.Context]
at org.thymeleaf.resourceresolver.ServletContextResourceResolver.getResourceAsStream(ServletContextResourceResolver.java:74)
at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:221)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1192)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1148)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1095)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1008)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:982)
at org.broadleafcommerce.common.email.service.message.ThymeleafMessageCreator.buildMessageBody(ThymeleafMessageCreator.java:54)
at org.broadleafcommerce.common.email.service.message.MessageCreator$1.prepare(MessageCreator.java:62)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:352)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:344)
at org.broadleafcommerce.common.email.service.message.MessageCreator.sendMessage(MessageCreator.java:40)
at org.broadleafcommerce.common.email.service.EmailServiceImpl.sendBasicEmail(EmailServiceImpl.java:96)
at org.broadleafcommerce.common.email.service.EmailServiceImpl.sendTemplateEmail(EmailServiceImpl.java:66)
at org.broadleafcommerce.common.email.service.EmailServiceImpl.sendTemplateEmail(EmailServiceImpl.java:73)
...
Our configuration is as described in :
http://docs.broadleafcommerce.org/core/ ... figuration
Other fora indicate that a WebContext should be used to solve this problem, in stead of the Context that is used in Broadleaf's ThymeleafMessageCreator impl. Does anyone recognize this problem and/or has a solution for this?
Thx in advance!
Jan
This forum is in readonly mode and serves as an archive of old information. All posting, registration and commenting abilities have been turned off. To get help, the Broadleaf team reguarly monitors the broadleaf-commerce tag on Stack Overflow so please ask your questions there.