Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
mjml-head-html-attributes
Advanced tools
Readme
This tag allows you to add custom attributes on any html tag of the generated html, using css selectors. It's not needed for most email creations, but can be useful in some cases, i.e. editable templates.
<mjml>
<mj-head>
<mj-html-attributes>
<mj-selector path=".custom div">
<mj-html-attribute name="data-id">42</mj-html-attribute>
</mj-selector>
</mj-html-attributes>
</mj-head>
<mj-body>
<mj-section>
<mj-column>
<mj-text css-class="custom">
Hello World!
</mj-text>
</mj-column>
</mj-section>
</mj-body>
</mjml>
In the generated html, a mj-text becomes a td
, and a div
inside this td
. In this example, the td
will have the class="custom"
. Using the css selector path=".custom div"
, the div
inside the td
will get the attribute data-id="42"
.
To use this component, you will likely have to look at the generated html to see where exactly are the css-class
applied, to know which css selector you need to use to add your custom attribute on the right html tag.
You can use multiple mj-selector
inside a mj-html-attributes
, and multiple mj-html-attribute
inside a mj-selector
.
FAQs
mjml-head-html-attributes
The npm package mjml-head-html-attributes receives a total of 443,638 weekly downloads. As such, mjml-head-html-attributes popularity was classified as popular.
We found that mjml-head-html-attributes demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.