Hi, i'm doing an e commerce with the backend in s...
# server
r
Hi, i'm doing an e commerce with the backend in spring and for recipes i'm returning mimeMessage emails but i'm building my htmls as strings dynamically, so it's a hard string process ... is there any library that you've used and recommend for doing this?
m
j
Or any templating engine (mustache, freemarker, etc). I've used MJML at build time to generate HTML templates with embedded mustache templates that get resolved at runtime and been pretty happy with the results
👍 1
n
Since you are using Spring why not use Thymeleaf just wondering
👍 2
t
Yeah any templating engine will work. Just generate your string with one of them, and send your email with something like this https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/mail/javamail/MimeMessageHelper.html https://www.baeldung.com/spring-template-engines Or you can use a third party email service, and build your email in a similar fashion.
r
thanks @Tom Hermann, already implemented thymeleaf and working really well now 🤓
💯 1
i was using a String.replace before (really slow and garbage code), now it's 3 times faster