> ## Documentation Index
> Fetch the complete documentation index at: https://docs.minimo.it/llms.txt
> Use this file to discover all available pages before exploring further.

# Email templates

> Create reusable transactional templates and send them by API, the app, or your agent, and edit the content without changing your code.

A **template** is a reusable email you send one contact at a time, triggered by an event, a welcome,
a receipt, a password reset. You write it once in Minimo and send it by its id from your backend, an
[automation](https://docs.minimo.it/product/automations/lifecycle.md), or your agent.

For one email sent to many contacts at once (a sale, a newsletter), see
[Email campaigns](https://docs.minimo.it/product/messaging/campaigns.md).

## Create a template

In **Templates → New**, write the subject, preview text and body. Templates support **dynamic
fields** (`{{firstName}}`, any contact or custom field), filled per recipient at send time.

> [!TIP]
>
> Describe the email in plain language and let **Mo** draft it: subject, body and dynamic fields. See
> [Build with Mo](https://docs.minimo.it/product/mo.md).

> [!NOTE]
>
> Templates send from a verified domain too. If you haven't set one up yet, do it first, see
> [Before you start](https://docs.minimo.it/product/messaging/campaigns.md#before-you-start).

## Edit the template, not your code

A template has one stable id. Your backend sends it by that id; you edit the content later in Minimo,
and the **next send uses the new version, with no redeploy and no code change**. This walkthrough
creates a template, sends it by API, edits the headline in the UI, then sends the exact same call
again, now with the updated content.

<video controls playsInline preload="metadata" poster="/images/tutorials/template-versioning-poster.png">
  <source src="https://mintcdn.com/minimo/5UV6O5ePk1LVPorS/videos/template-versioning-narrated.mp4?fit=max&auto=format&n=5UV6O5ePk1LVPorS&q=85&s=73b5e1480e2a16cf7b3434f4843a837f" type="video/mp4" />
</video>

Create a template, send it by API, edit it in the UI, and the same call sends the new version. Press play to follow along.

## Send a template

> [tab] From the app
>
> Open the template and use **Send test** to send yourself a copy, or wire it into an
> [automation](https://docs.minimo.it/product/automations/lifecycle.md) so it fires on an event.

> [tab] From the API
>
> Send a stored template to a contact with a single call. See [Send an email
> template](https://docs.minimo.it/api-reference/messaging-channels/email/send-template.md), or [Send a one-shot HTML
> email](https://docs.minimo.it/api-reference/messaging-channels/email/send-html.md) to send a pre-rendered payload without a
> stored template.

> [tab] From your agent
>
> Ask your connected agent: *"Send the welcome email to [jane@example.com](mailto:jane@example.com)."* Mo picks the template and
> sends. See [Connect your agent](https://docs.minimo.it/guides/connect-your-agent.md).

> [!NOTE]
>
> Sending the same message repeatedly (e.g. retrying a failed request)? Use an [idempotency
> key](https://docs.minimo.it/api-reference/overview/conventions.md) so a contact isn't emailed twice. Prefer to fire emails
> automatically on an event? Use an [automation](https://docs.minimo.it/product/automations/lifecycle.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.