Class ThymeleafMjmlService
java.lang.Object
dev.jcputney.mjml.spring.ThymeleafMjmlService
Service that combines Thymeleaf template processing with MJML rendering. First processes
Thymeleaf expressions, then renders the resulting MJML to HTML.
-
Constructor Summary
ConstructorsConstructorDescriptionThymeleafMjmlService(org.thymeleaf.TemplateEngine templateEngine, MjmlService mjmlService) Creates a Thymeleaf + MJML composition service. -
Method Summary
Modifier and TypeMethodDescriptionProcesses an inline MJML template string through Thymeleaf, then renders to HTML.renderTemplate(String templateName, Map<String, Object> variables) Loads a template by name via Thymeleaf, processes it, then renders as MJML to HTML.
-
Constructor Details
-
ThymeleafMjmlService
Creates a Thymeleaf + MJML composition service.- Parameters:
templateEngine- Thymeleaf engine used for template processingmjmlService- MJML rendering service applied to processed template output
-
-
Method Details
-
render
Processes an inline MJML template string through Thymeleaf, then renders to HTML.- Parameters:
mjmlTemplate- the MJML template string with Thymeleaf expressionsvariables- the template variables- Returns:
- the rendered HTML string
-
renderTemplate
-