Add template support to e-mails
Wrapping messages into templates like:
Hello {userName},
{body}
{optionalLink}
Thanks,
{teamName}
This can be done by providing API with option to add something like TemplateProvider or by creating TemplateProvider bean on client side and auto-wiring it in MailService.
+1 for that. It would be great if Thymeleaf will be supported. See https://www.thymeleaf.org/doc/articles/springmail.html and https://stackoverflow.com/questions/41599954/how-to-process-txt-e-mail-template-with-thymeleaf
@php-coder I was also thinking about Thymeleaf but I'm not yet sure what is the best way to implement it.
@jpomykala ThymeLeaf Documentation 4.4 refers to mapping the object details to the template. It is in a text format.
Amazon ses mentions the data can be text as well as html. We can use ThymeLeafs template Engine in 4.3 or 4.4 to implement the same in MailService sendEmail.
I found also something like Pebble https://pebbletemplates.io worth to consider :)
@jpomykala Nice an alternative templating engine. I guess both should get the job done. I don't think there must be a huge pro and con to choosing either. Will have to import the dependencies separately anyway.
In the pebbletemplate docs I do not see an option for text , like the one I see in thymeleaf 4.4.