> For the complete documentation index, see [llms.txt](https://docs.artific.nl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.artific.nl/en/for-administrators/conversations/mail-templates.md).

# Mail templates

The branded frame wrapped around every reply sent from a channel. Reached from a channel's row menu, via **Edit mail template**.

## What it is for

The assistant writes the body of a reply. The template supplies everything around it: your header, greeting, signature, logo and layout. Without one, replies go out as bare text.

Each channel has its own template, so `support@` and `info@` can look different.

## The screen

Two columns: the **Editor** on the left, a live **Preview** on the right. The preview uses your real name and organisation, so what you see is close to what a recipient gets.

The editor is a normal rich-text editor: bold, italic, lists, links, images, tables, fonts, sizes, line spacing and colour.

## Variables

Below the editor is a row of **Available variables** as clickable chips. Clicking one inserts it where your cursor is. Chips already used in the template turn green.

| Variable                   | What it becomes                           |
| -------------------------- | ----------------------------------------- |
| `body`                     | The reply itself.                         |
| `user.name`                | The name of the person sending.           |
| `user.company`             | Your organisation's name.                 |
| `customer.firstName`       | The recipient's first name. May be empty. |
| `customer.email`           | The recipient's e-mail address.           |
| `conversation.subject`     | The subject of the conversation.          |
| `conversation.referenceId` | A unique reference for this conversation. |

{% hint style="warning" %}
`body` must appear exactly once. Without it the assistant's reply is not inserted at all and the recipient gets an empty shell. With it more than once, only the first is used. The editor warns you about both.
{% endhint %}

`customer.firstName` can be empty, because not every sender's name can be determined. Write your greeting so it still reads properly when it is: *"Hello {{ customer.firstName }},"* becomes *"Hello ,"*. A greeting that does not depend on the name is safer.

## Building a template

A workable structure:

1. Your logo and a header bar.
2. A greeting.
3. `body`: the reply.
4. A closing line and signature, using `user.name` and `user.company`.
5. A footer with contact details, and the conversation reference if you use one for tracking.

Keep it simple. E-mail clients render elaborate layouts unpredictably, and a plain, clean template survives better than a designed one.

## Saving

**Save** stores the template. It is disabled while the template contains a variable that is not on the list. The editor tells you which, and you must remove it or replace it with one of the chips.

Warnings about a missing or duplicated `body` do not block saving, but you should act on them.

**Cancel** leaves the screen without saving. Navigating away with unsaved changes prompts first.

## Testing

Send a message to the channel from an outside address, let the assistant draft a reply, and send it to yourself. Read it on a phone as well as a computer. That is where layout problems show up.
