mjml.image

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

Create an MJML <mj-image> 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-image>

Examples

With children:

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

result = image(child)

With attributes:

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

With both:

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