Class MjmlThymeleafAutoConfiguration
java.lang.Object
dev.jcputney.mjml.spring.autoconfigure.MjmlThymeleafAutoConfiguration
@Configuration
@ConditionalOnClass({org.thymeleaf.TemplateEngine.class,MjmlService.class})
@ConditionalOnProperty(name="spring.mjml.thymeleaf-enabled",
havingValue="true",
matchIfMissing=true)
public class MjmlThymeleafAutoConfiguration
extends Object
Auto-configuration for Thymeleaf + MJML integration. Only activates when Thymeleaf is on the
classpath.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionthymeleafMjmlService(org.thymeleaf.TemplateEngine templateEngine, MjmlService mjmlService) Auto-configuresThymeleafMjmlServicewhen Thymeleaf is available.
-
Constructor Details
-
MjmlThymeleafAutoConfiguration
public MjmlThymeleafAutoConfiguration()
-
-
Method Details
-
thymeleafMjmlService
@Bean @ConditionalOnMissingBean public ThymeleafMjmlService thymeleafMjmlService(org.thymeleaf.TemplateEngine templateEngine, MjmlService mjmlService) Auto-configuresThymeleafMjmlServicewhen Thymeleaf is available.- Parameters:
templateEngine- the Thymeleaf template enginemjmlService- the MJML rendering service- Returns:
- the configured Thymeleaf MJML service
-