> For the complete documentation index, see [llms.txt](https://docs.codemash.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codemash.io/cloud/emails/templates/editor.md).

# Template editor

**Where:** Email → Templates → New / Edit · `/projects/<project>/emails/templates/new · …/<templateId>/edit`

**Add New Email Template** / **Edit Email Template** builds multilingual email templates: one subject and one MJML/HTML body per language, plus the channel classification that controls unsubscribe preferences.

{% hint style="info" %}
Screenshot TODO — capture comes from testing-plan area **13-emails**.
{% endhint %}

## Fields

* **Template name** (required) and **Description** (up to 500 characters).
* **Translations** — pick languages as tags; each selected language gets its own block with:

  * **Subject** (required) — plain text with tokens, e.g. `Welcome @Model.FirstName to our app!`.
  * **Template** (required) — the MJML/HTML body in a code editor, or visually in the full-screen **Template Visual Builder**. A live preview renders next to the code.

  When a recipient's preferred language matches a translation, that translation is sent automatically.
* **Marketing Email / Transactional Email** — a radio choice with matching **Marketing Tags** / **Transactional Tags**. Tags connect the template to the notification preference groups users can unsubscribe from.

Tokens use Razor syntax: `@Model.X` for custom tokens bound at send time, and reserved tokens such as `Project.Name`, `Initiator.User.Email`, or `Recipient.User.FirstName` that resolve automatically. Helper functions are also available — for example `@Model.Cmf.RenderSignature(Model.Email.SignatureId)` and `@Model.Cmf.RenderFooter(Model.Email.FooterId)` insert a shared [signature](/cloud/emails/signatures.md) or [footer](/cloud/emails/footers.md), and `@Model.Cmf.RenderUnsubscribeLink(...)` adds the unsubscribe link. Only allow-listed `Cmf` functions compile — the editor flags any other. See [Tokens binding](/other-topics/tokens-binding.md).

**Create** / **Update** saves the template (`tmpl_…`); its id then appears as a copyable button and every send that points at this id picks up the new content. On a saved template you also get **Test** (send a real test email through a chosen provider) and an actions menu with **Create Campaign** (opens [Create a Campaign](/cloud/emails/campaigns/new.md) with this template preselected), **Archive** / **Unarchive**, **Clone**, and **Delete**.

## Use it from code

[Create Email Template](/sdks-and-cli/notifications/email/create-email-template.md) · [Update Email Template](/sdks-and-cli/notifications/email/update-email-template.md)

## API reference

Endpoints: [Create Email Template](/api-reference/notifications/email/create-email-template.md), [Update Email Template](/api-reference/notifications/email/update-email-template.md), [Clone Email Template](/api-reference/notifications/email/clone-email-template.md), [Archive Email Template](/api-reference/notifications/email/archive-email-template.md).
