Replies: 2 comments 1 reply
-
mj-html-attribute allow you to do so if you want. But if it's in tag like
mj-text you're free to add whatever you want to the html
…On Fri, Feb 14, 2025 at 10:51 PM Karen Schaper ***@***.***> wrote:
I wish I could add attributes like data-role="subject" so that in a test I
can use Floki and find this element and assure that the subject of the
email is correct.
—
Reply to this email directly, view it on GitHub
<#2936>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAELHTOEEKC5TQXDNOULNR32PZQO3AVCNFSM6AAAAABXFQTAPOVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXHE3DOOBQHE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
That's expected as mj-text and other tag won't render to 1 HTML tag. We
can't really know if you want to put the attribute on the very first dom
element or the last one produce by the tag.
You can apply it with mj-html-attribute given a proper css selector to
apply it https://documentation.mjml.io/#mj-html-attributes
Keep in mind this method could be very slow, so if you have multiple
selector, consider just using HTML tag as most do.
…On Sun, Feb 16, 2025 at 7:04 PM Karen Schaper ***@***.***> wrote:
oh yes I was able to if I added more to the template. The templates I am
modifying are pretty much only using the <mj-** tags and I don't see my
attributes if add to that
<%= @header_message %>
This would work but then I am adding html for the purpose of testing and
not sure if that's palatable.
<%= @header_message %>
—
Reply to this email directly, view it on GitHub
<#2936 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAELHTJSLTTX47M27PAKELL2QDHJJAVCNFSM6AAAAABXFQTAPOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMRRGY3TONQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wish I could add attributes like data-role="subject" so that in a test I can use Floki and find this element and assure that the subject of the email is correct.
Beta Was this translation helpful? Give feedback.
All reactions