https://kotlinlang.org logo
Title
r

ReddyTintaya

07/30/2020, 5:10 PM
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

Marc Knaup

07/30/2020, 5:54 PM
j

Joe

08/01/2020, 8:32 PM
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

nicholasnet

08/02/2020, 5:10 PM
Since you are using Spring why not use Thymeleaf just wondering
👍 2
t

Tom Hermann

08/07/2020, 12:41 AM
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

ReddyTintaya

08/07/2020, 12:47 AM
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