Interface ContentSanitizer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Optional hook for sanitizing HTML content within
<mj-text>, <mj-button>, and
<mj-raw> elements.
By default, MJML passes through inner HTML content as-is (matching the official MJML
behavior). Configure a ContentSanitizer on MjmlConfiguration when you need to
scrub user-supplied HTML before it appears in the rendered email.
Example
MjmlConfiguration config = MjmlConfiguration.builder()
.contentSanitizer(html -> Jsoup.clean(html, Safelist.basic()))
.build();
-
Method Summary
-
Method Details
-
sanitize
-