Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to allow rendering of HTML comments for E-Mail support #441

Open
danielhaake opened this issue Mar 24, 2025 · 2 comments
Open

Comments

@danielhaake
Copy link

I use MJML to generate e-mails in HTML format. MJML can be used to generate HTML output that can be used for various browsers and e-mail clients. Also for Outlook under Windows, which otherwise causes many problems. Among other things, MJML generates HTML comments, so that Outlook, for example, knows that it has to display the HTML differently.

Example of an MJML file:

Image

The generated HTML output including the required HTML comments:

Image

JTE does not render comments. This is a problem for this use case. Because the comments are required. If the comments were also rendered, the JTE syntax could be incorporated using and, for example, sections could be repeated based on the transferred data.

It would therefore be very desirable for the use case if it were possible to set that HTML comments should be rendered as well. Could this be implemented?

@casid
Copy link
Owner

casid commented Mar 27, 2025

Hi, MJML looks pretty cool, will have a look at this!

You can preserve comments by setting this to true:
gg.jte.TemplateEngine#setHtmlCommentsPreserved

If you use Maven or Gradle to precompile templates, you would need to set this there as well.

@danielhaake
Copy link
Author

danielhaake commented Mar 27, 2025

That sounds great! I'll give it a try.

Can you include this information in the documentation (or did I missed it)? It could certainly be of interest to others too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants