-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Allow arbitrary value inside mj-raw #252
Comments
@thiamsantos if you take a look at Catapulte, I ran into the same problem and ended up putting a template management system on top of MRML. |
That's basically the approach that I'm taking today. Using a template engine to generate the mjml and then converting the final MJML directly to HTML right before sending the email. (templated MJML -> MJML -> HTML) In my use case, by allowing putting the special tags inside the mj-raw I could run the MJML conversion to HTML in compile time, and avoid the conversion on every email send. (templated MJML -> templated HTML -> HTML) |
It looks like the standard for this is to use a comment before the invalid html.
Right now this will return a parse error. I feel like it should correctly do what mjml expects it to do, which is compile. LMKWYT. |
We have been facing a similar issue, but it is not exactly related to templating and more because MRML expects valid HTML within a <mjml>
<mj-body>
<mj-raw>
<span>Some text that we don't control with a chevron <> that MRML is raising an error</span>
</mj-raw>
</mj-body>
</mjml> We tried the following 👇 but that didn't work either {% if foo < 5 %} <mjml>
<mj-body>
<mj-raw>
<!-- htmlmin:ignore -->
<span>Some text that we don't control with a chevron <> that MRML is raising an error</span>
<!-- htmlmin:ignore -->
</mj-raw>
</mj-body>
</mjml> PS: We solved this by escaping <>, but still, it feels unexpected for MRML to expect valid HTML in there... ( |
Thanks for the feedback. I didn't find a good parsing library that handles all those cases yet. |
First of all thanks for the awesome library.
I'm trying to add templating tags directly inside mjml. According to the docs https://documentation.mjml.io/#mj-raw we can accomplish it using the
mj-raw
tag.Right now mrml seems to support only valid html inside the tags. Would be nice if we could pass any arbitrary value inside the mjml to be able to latter pass the generated html to our templating engine.
Examples of the mjml code:
If this feature is welcoming, I would be happy to send a PR for it, I would probably just need to some guidance on the code.
The text was updated successfully, but these errors were encountered: