lttr

Markdown emails, your design

lttr is a Go engine that turns Markdown templates into Outlook-safe HTML and a plain-text email. The look isn't lttr's: it comes from a kit you own, your tokens, your components, your markup. Every merge tag, binding and component is checked at compile time, so a broken template stops your service at startup, never in an inbox.

One template, one real email

This is the order email from Loam, the farm-to-door marketplace the Quiet kit is built for, next to the email lttr renders from it. {{courier.first_name}}, {{eta}} and the :order binding are checked against the template's Go type when it compiles, and a typo stops the service at startup, with the file, line and column.
01-box-on-its-way.md
---
template: order.out_for_delivery
profile: buyer
subject: Your produce box is on its way
preheader: "Arriving at {{destination}} by {{eta}} today."
note: "Questions? [Get help](https://loam.example/help). Payment is held until you confirm delivery."
---

::statement{eyebrow="Order {{order_id}}"}
# On its way.

{{courier.first_name}} picked it up at {{picked_up_at}}.\
Due in {{destination}} by {{eta}}.

:button[Track delivery]{href="{{track_url}}"}
::

::progress{steps="Confirmed, Packed, On its way, Delivered" current="On its way"}
::

::receipt{:order="order"}
::

::meta
### Deliver to
{{deliver_to.name}}
{{deliver_to.address}}

### Courier
{{courier.name}} · ★ {{courier.rating}}
{{courier.vehicle}}
::
375 px · mobile

The same engine, a different kit

Swap the kit and the same engine, the same components-as-Markdown syntax and the same compile-time checks produce a different email. This is Plain, lttr's small neutral starter kit: lttr kit init copies it as the base for your own.
plain/samples/welcome.md
---
template: welcome
profile: default
subject: "Welcome to Example, {{first_name}}"
preheader: Your workspace is ready. Three things to set up first.
---

# Welcome, {{first_name}}

Your workspace **{{workspace}}** is ready. Most teams start with these three steps:

1. Invite your teammates
2. Connect a calendar
3. Pick a plan before {{trial_ends}}

::button{href="{{setup_url}}" label="Finish setting up"}
::

::image{src="{{cover_url}}" alt="An empty workspace waiting for its first project" width="496" caption="Your workspace, before the first project."}
::

::columns
:::column
### Guides
Short walkthroughs for every feature, most under five minutes.

:link[Read the guides]{href="https://example.com/guides"}
:::

:::column
### Help
Stuck on something? Reply to this email and a person will answer.

:link[Visit the help centre]{href="https://example.com/help"}
:::
::

::footer{note="You are receiving this because you created an account at Example. [Email settings](https://example.com/settings)"}
::
375 px · mobile

What you get

The engine holds no brand of its own. Colours, fonts, logo, senders and footer copy are yours, supplied by a kit; lttr supplies the checks and the markup.
Your design, as a kit
Tokens, layout, components and copy live in a kit, a directory of templates and YAML. Start from Plain, study Quiet, or build your own; lttr kit init copies Plain as the starting point.
Checked before it sends
kit.Load type-checks every kit template once. Compile then checks every merge tag, binding and component in your template against your Go type and the kit's schemas, and returns every error at once, each at name:line:col.
Outlook-safe HTML
Table-based markup with inline styles, fixed-width Outlook tables and VML buttons, all emitted through conditional comments. Every URL is checked before it is written.
Dark mode and mobile
A kit's colour tokens can carry light and dark values, applied under prefers-color-scheme and repeated for Outlook.com. Multi-column components stack below 480px.
Plain text from the same source
The text part renders from the same laid-out document as the HTML, not scraped from it: headings, links, tables and the footer each have their own text form.
Profiles and SMTP
A Profile fixes a sender and its headers; Message.Profile lets your application route mail its own way. SMTP sends over STARTTLS, or take the raw bytes with Message.MIME.
Studio
lttr serve watches the kit and re-renders what each save changed: a grid of every sample, and each email at 600 and 375 px, in light and dark, with its problems.

Ready to send your first one?

Install the module, copy the quick start, and you have a typed, kit-checked template rendering to HTML and text in one file.
Copyright © 2026