8/14/2023 0 Comments Mjml variables![]() It's just this small issue that concerns me. We are falling in love with the documentation, app, VS Code extension, etc. Thanks again for maintaining mjml through the years. First, compile the template (only once), then, use directly the compiled template (thousand of times, once per email sent). Or maybe in the future MJML could expose this compilation step on load time, with some mechanism like lodash _.template offers. Or maybe MJML has a very optimized way of doing this internally? I'm not loading conditionally different mj-components. That’s because each email client supports different subsets of HTML and CSS properties. As you’ll see in this guide, there are major differences between web and email development. The HTML is not changing, only the content (the news in the newsletter). HTML and CSS may be the best-known way to code, but MJML is made for coding emails. And then adapt that HTML to limited but performant lodash templates that we can interpolate fast with _.template. We would leave mjml for development -> export HTML. I can see this is great workflow and it seems to work for many people, because I don't see anyone complaining about performance, etc.īut in our case, only 1 simple email template with a list of news, that needs to be very performant (50K emails per day), I'm concerned (maybe irrationally) about the performance. And your recommendation is to do something like this (as an example) I see, the benefit of looping with more complex templating language, and partials with mj-include. Is it possible to do something like this? I'm happy to work on it if it's not possible yet (and the design of the project allows I see, thanks for the tip and quick reply!. So we would like to inverse the process to (mjml -> jinja -> html), but to do that we need to be able to run the mjml engine in partials, as we have the mjml templates split into different partials that are rendered using Jinja. ![]() Ideally we would like to cache the templates, but currently is impossible as when the process reaches the mjml phase, the template already has all the variables interpolated, and the template is not generic anymore (it's for an specific user). We have a template engine that is interpolating some variables (and blocks), and after that, we generate the HTML using mjml ( Jinja -> MJML -> HTML).Ĭurrently, we are facing a performance problem in mjml, as it's our current bottle-neck in the process (calling a JS script from another language isn't very performant). Our use case is very similar to the one expressed on that issue. I was wondering if there is any possibility of rendering parts of a template, without generating the full document structure.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |