Email.Mjml
HTML & web
Types
Mjml
type Mjml = MjmlAn opaque email layout node.
Examples
Email.Mjml.text "Hello"Values
text
text : String -> MjmlA text node.
Examples
Email.Mjml.text "Hello"node
node : String -> List Attribute -> List Mjml -> MjmlA custom component by tag name.
Examples
Email.Mjml.node "custom" [] [ Email.Mjml.text "Hi" ]void
void : String -> List Attribute -> MjmlA void component (no children) by tag name.
Examples
Email.Mjml.void "image" [ Email.Mjml.Attributes.src "https://cdn/logo.png" ]mjml
mjml : List Attribute -> List Mjml -> MjmlRoot document wrapper.
Examples
Email.Mjml.mjml [] [ Email.Mjml.body [] [] ]body
body : List Attribute -> List Mjml -> MjmlMessage body container (centered width, background).
Examples
Email.Mjml.body [] [ Email.Mjml.section [] [] ]section
section : List Attribute -> List Mjml -> MjmlFull-width horizontal band.
Examples
Email.Mjml.section [] [ Email.Mjml.column [] [] ]column
column : List Attribute -> List Mjml -> MjmlColumn inside a section.
Examples
Email.Mjml.column [] [ Email.Mjml.textBlock [] [] ]textBlock
textBlock : List Attribute -> List Mjml -> MjmlStyled text block (mj-text).
Examples
Email.Mjml.textBlock [] [ Email.Mjml.text "Hi" ]button
button : List Attribute -> List Mjml -> MjmlCall-to-action button (mj-button).
Examples
Email.Mjml.button [ Email.Mjml.Attributes.href "/confirm" ]
[ Email.Mjml.text "Confirm" ]image
image : List Attribute -> MjmlImage (mj-image).
Examples
Email.Mjml.image [ Email.Mjml.Attributes.src "https://cdn/logo.png" ]divider
divider : List Attribute -> MjmlHorizontal rule (mj-divider).
Examples
Email.Mjml.divider []spacer
spacer : List Attribute -> MjmlVertical gap (mj-spacer).
Examples
Email.Mjml.spacer [ Email.Mjml.Attributes.height "16" ]toHtml
toHtml : Mjml -> StringRender to email-safe HTML.
Examples
Email.Mjml.toHtml treetoText
toText : Mjml -> StringRender a simple plaintext alternative from the tree.
Examples
Email.Mjml.toText tree