I evaluate mjml as a tool for making my days less horrible when I need to do something with transactional emails and there is one feature that I can't find any informations of but I'm just sure there is a way for people to do it right.
Reusable layout.
I used to write emails in pug and it was basic feature there. I know mjml wants to be a framework and not template engine but they do have "mj-include" and layout is kind of reverse include.
Pseudo code explaining what I would like to achieve:
layout.mjml
<mjml>
<mj-head>...</mj-head>
<mj-body>
... some header
<mj-this-is-where-content-comes><</mj-this-is-where-content-comes>
... some footer
</mj-body>
</mjml>
welcome-user.mjml
<mj-layout src="./layout.mjml">
<mj-text>
Hi user!
</mj-text>
</mj-layout>
Based on my reading I see few ways how people could deal with it:
mj-include <= documentation examples stands on that, still requires lots of copy and paste for each template
wrapping template with layout in compile process <= I'm loosing the power of mjml tools in this case, I could though set-up watchers that compile and wrap my code in layout for each change
custom component <= seems like the best option but aren't reusable layouts such a common case that if it would be a solution then by now I would probably find custom component for it