mjml.html_attributes

mjml.html_attributes(*args, attributes=None, content=None)

Create an MJML <mj-html-attributes> tag.

Parameters

*args : TagChild = ()

Children (MJMLTag objects)

attributes : Optional[TagAttrs] = None

Optional dict of tag attributes

content : Optional[str] = None

Optional text content for the tag

Returns

: MJMLTag

MJMLTag object representing <mj-html-attributes>

Examples

With children:

from emailer_lib.mjml import html_attributes, text
child = text("Hello World")

result = html_attributes(child)

With attributes:

result = html_attributes(attributes={"attr": "value"})

With both:

result = html_attributes(child, attributes={"background-color": "yellow"})