groupe-sii / ogham

Sending email, sms or whatever is a piece of cake
https://groupe-sii.github.io/ogham/
Apache License 2.0
21 stars 15 forks source link

FreeMarker template resolving issue using ogham.email.template.prefix #45

Closed aurelien-baudet closed 7 years ago

aurelien-baudet commented 7 years ago

When using a FreeMarker template using a name, a variant and the property ogham.email.template.prefix, it seems that the template resolution doesn't work.

Template file in classpath: /email/delivery.txt.ftl Sending email using: new Email().content(new MultiTemplateContent("delivery")) Configuration: ogham.email.template.prefix=/email/ Using Spring Boot

=> Template not found

It seems that ClassPathResolverAdapter is using a particular class for resource resolution instead of ClassLoader so the path is relative the package of the class

aurelien-baudet commented 7 years ago

The same Configuration instance was used for both sms and email leading to override of template path prefix