# Email that sends

The Email tool makes two families of output from one place: a mail-window **Mock-up** for slides and walkthroughs, and three sendable kinds (**Newsletter**, **Offer** and **Announcement**) that export table-based HTML, plain text and a ZIP bundle ready for an organisation's own sending system.

Lolly writes the file on your device. Lolly holds no recipient list and sends no message.

## Kinds

| Kind | What changes | Formats |
|---|---|---|
| **Mock-up** | Mail-window illustration with sender, recipients, subject, Markdown message and attachment chips | PNG, SVG, PDF, JPEG, WebP, MP4, WebM, GIF, HTML |
| **Newsletter** | Header, subject, preheader, Markdown message, a table of stories, a button, legal lines and a footer | HTML, TXT, ZIP, PNG, PDF |
| **Offer** | Header, subject, preheader, Markdown message, a 2-across or 3-across grid of offer tiles with prices and dates, a button, legal lines and a footer | HTML, TXT, ZIP, PNG, PDF |
| **Announcement** | Header, subject, preheader, Markdown message, a button, legal lines and a footer | HTML, TXT, ZIP, PNG, PDF |

A saved link with no `kind` opens as a **Mock-up** and draws the same picture as before.

## What goes into a sendable file

- **Layout:** Nested `<table role="presentation">` markup in a 600 px column, fluid on narrower screens, with inline styles on every element. One optional `<style>` block adds dark-mode and mobile-stacking rules; the layout holds its structure when that block is stripped.
- **Closed element and attribute list:** Scripts, forms, iframes, embedded objects, remote font fetches, SVG elements, event attributes, `javascript:` links, `data:` addresses and tracking pixels are never written.
- **Pictures:** Remote `https://` picture addresses are never fetched during preview; the canvas draws a placeholder box with the picture's alt text instead. In a ZIP export, local or brand pictures are bundled under `images/` beside `email.html` and `email.txt`.
- **Merge fields:** Placeholders such as `{{first_name}}` are declared in **Merge fields** with sample values for preview (`first_name=Alex`). Exported files keep the placeholders intact in the sending system's wrapper (`{{ }}` by default) and never substitute recipient data.
- **Plain-text part:** Export **TXT** (or open `email.txt` inside the **ZIP**) for a matching plain-text message with headings, paragraphs, links formatted as `Label: https://example.com`, and the footer.

## Checks before export

Exporting **HTML**, **TXT** or **ZIP** stops with a message pointing at the input when:

- **Organisation**, **Postal address** or **Unsubscribe link** is empty.
- A header picture, story picture or offer tile picture lacks an `https://` address or alt text.
- A text or link field contains a merge field that is not listed in **Merge fields**.
- A link's visible text looks like a web address that differs from its target address.

When the active design system lists allowed domains in `email.linkDomains`, links outside those domains show a warning under the input.

## Sender defaults from a design system

A design system can supply sender defaults in an optional `email` token group:

```json
{
  "email": {
    "organisation": { "$type": "string", "$value": "Lolly Demo Pty Ltd" },
    "address": { "$type": "string", "$value": "1 Example Street, Sampletown" },
    "linkDomains": { "$type": "string", "$value": "example.com" },
    "imageBase": { "$type": "string", "$value": "https://assets.example.com/email/" },
    "mergeWrap": { "$type": "string", "$value": "{{ }}" }
  }
}
```

On an editable design system, **Organisation** and **Postal address** default to those tokens when left empty. On a locked or managed design system that defines `email.organisation` or `email.address`, the footer inputs are hidden and the design system's values are fixed.

## Mail client checks

Automated layout checks verify the 600 px column structure at 320 px, 600 px and 1280 px with and without the `<style>` block. Record manual client checks below as they are verified:

| Client | Platform | Date checked | Notes |
|---|---|---|---|
| Apple Mail | macOS / iOS | Pending manual check | 600 px table column, inline styles, dark colour-scheme meta |
| Gmail | Web | Pending manual check | Layout verified with `<style>` block stripped |
| Outlook | Web | Pending manual check | Presentation tables and inline widths |
| Thunderbird | Desktop | Pending manual check | HTML and plain-text parts |

---

Code ([MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/)) · Content ([CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)) · [lolly.tools](https://lolly.tools)
