The plain-text fallback¶
With no sibling .txt, the text part is made from the rendered HTML with
html2text, tuned so it reads as an email and not as
Markdown.
| In the HTML | In the text |
|---|---|
| MJML's layout tables | Unwrapped: paragraphs, no \| and --- around everything |
An <mj-table> |
A real table, with its columns padded to line up |
<mj-button href="../…">Label</mj-button> |
Label: https://…, on a line of its own |
<a href="https://x/">here</a> |
here (https://x/); just the address if the label is the address |
<a href="#top">…</a> or no href |
Just the label |
<strong>, <em> |
The plain words, with no ** or * |
<h1>, <h2> and so on |
The two shallowest levels used are underlined with = then -; deeper ones are plain lines |
é © — |
é © —, not an ASCII approximation |
<img> |
Dropped |
A paragraph starting 1. or - |
Kept as written, with no backslash |
Lines are not wrapped (the mail client does that) and there are no trailing spaces.
Generated or hand-written¶
The fallback is built for transactional mail, so it reads as an email: no Markdown markers, tables that line up, links that keep their address. It is a translation of the HTML, so it can only say what the HTML says.
Write a .txt when you want something a person
would write by hand: a signature block, a short summary, different wording. See
Write the plain text by hand.