-
Notifications
You must be signed in to change notification settings - Fork 932
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
[Improvement] define <mj-attributes> and alike in a template file called by <mj-include> #367
Comments
Define your attributes in a head.mjml file and include before the body: For example:
|
This works for me, and allows me to define specific styles for a template that aren't in the 'standard' head.
|
Well it makes sense to merge all mj-head inside mj-include files, but I wonder if it will introduce style conflict between included part. I'm adding a discussion label to this to see if it's relevant to keep |
It would be great. Now, it's very difficult to maintain a global template. If you want to change a global style to all email templates, you need to replace styles in all your templates. It's really tedious. In the meantime, it is possible to use a module like gulp-include-file or gulp-include-file to fill this gap. |
In 3.2, you'll be able to define an Note that some file can override some of your current We should drop a beta this week so feel free to give it a try 👍 |
Great--these are all features that we're looking forward to. If we add an |
@jdotjdot they will both be applied ! |
Hi there, MJML 3.2 has been released on NPM so you can now use mj-head inside your partials ! |
Hello there!
For now, we can define attributes within
<mj-head>
tag, which is a good DRY feature.Yet, it is impossible to do the same within a template called by a
<mj-include>
tag, since these templates are usually within the<mj-body>
tag. It means then you have to declare the attributes within the main file, which is not great regarding the separation of concern.Why not aggregating all the
<mj-head>
parts along all the templates while compiling to HTML?Thank you and happy coding!
The text was updated successfully, but these errors were encountered: