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

# Template editor

> How to create, save and discard a template draft: base fields, texts per language, variables, preview and sample data.

## At a glance

| Field | Value |
| - | - |
| Status | **Available** |
| Route | `/{locale}/notification/catalog/{event}/channels/{channel}` (Versions tab with `?tab=versions`) |
| Menu | Notifications › Catalog › **Event catalog** › an event › **Channels** tab › a channel |
| Role | Every Notifications role reads; Notification Admin, Editor and Marketing edit |
| Permission | `notification-template:find-one` to see; `notification-template:edit` to create, save and discard drafts |
| Feature flag | None |
| Last verified | 2026-11-20 against `develop` (`aed8bd19b`) |

## What it is for

The editor is where you change what a notification says. You never edit the version that is going out: you work on a
**draft**, test it and, when it is ready, publish it. Until you publish, sends keep using the current version.

## How to get there

* Open the event in the [catalog](https://docs.bbrands.io/enterprise/notifications/catalog/list.md) and go to the **Channels** tab. Press the
  channel name, or open its card menu and choose **Edit template**
  ([Event channels](https://docs.bbrands.io/enterprise/notifications/catalog/channels.md)).
* Every template belongs to a channel of an event: there is no separate template list any more. An old
  `/notification/templates/{id}` link opens the new editor and `/notification/templates`, the catalog.
* The arrow next to the title goes back to the event's **Channels** tab.

## What you see

![Push template editor of the Club coupon redeemed event, v4 Draft, under Notifications › Event catalog › Club coupon redeemed: Save draft, Discard draft, Test send and Publish buttons; Editor and Versions tabs; Base fields card with Action type, Action target, App, Buttons, Icon and Image, each with its help and technical key; Preview ES card with the push on iOS and Android, followed by Sample data and the Variables card with couponName, merchantName and the common variables.](https://mintcdn.com/bbrands/N7_SfPLw3NjOYuO9/images/enterprise-notifications-screens/templates/editor.en.desktop.webp?fit=max\&auto=format\&n=N7_SfPLw3NjOYuO9\&q=85\&s=be9a0fc4882e11eee86e34fa7b708af5)

The editor on a push draft: base fields, variables and the iOS and Android preview.

| # | Element | What it does |
| - | - | - |
| 1 | Title and chips | **{channel} template** (for example **Push template**); under the title, the `event:channel` key, the version number and its state (**Draft** or **Published**). The trail above reads Notifications › **Event catalog** › the event |
| 2 | **Create draft** | Shown when there is no draft: creates one from the current version |
| 3 | **Save draft** / **Discard draft** | Shown when there is a draft; save enables once there are changes |
| 4 | **Test send** | Sends the version to yourself ([Preview and test](https://docs.bbrands.io/enterprise/notifications/templates/preview-and-test.md)) |
| 5 | **Publish** | Makes the draft the current version ([Publish](https://docs.bbrands.io/enterprise/notifications/templates/publish.md)) |
| 6 | **Base fields** | What does not change per language: action, app, sender, layout. Each field shows its name, a short help and, in grey, its technical key |
| 7 | **Texts** | One tab per language with the channel texts ([Languages](https://docs.bbrands.io/enterprise/notifications/templates/languages.md)) |
| 8 | **Preview** | At the top of the right column: how it looks in the chosen language, with the sample data |
| 9 | **Sample data** | Example values for the preview and the test |
| 10 | **Variables** | At the end of the right column: the event data you can insert ([Variables](https://docs.bbrands.io/enterprise/notifications/templates/variables.md)) |

Without a draft, the **Published version (read only)** chip shows next to the title. On hover it says "Create a draft
to edit the texts and the base fields." or, if your role does not edit, "You can read the published version; your
role cannot edit it."

While it loads, the whole screen shows at once: the trail, the title, the tabs and the field labels are already there,
and each value still on its way has its own skeleton of the same size, the event name in the trail included. Nothing
jumps when the data arrives.

## Step by step

### Change a text

**1. Create a draft**

Press **Create draft**. You see **Draft created**: "It starts from the current version." If a draft already
exists, you work on it.

**2. Edit**

Change the texts under **Texts**, starting with **ES**. **Unsaved changes** shows at the top.

**3. Save**

Press **Save draft**. If everything is fine you see **Draft saved**: "Every language passed validation." If
something fails, **Draft saved with errors**: "Fix the fields marked in: ES, EN", and each field in error is
marked.

**4. Review, test and publish**

Check the preview, send yourself a **Test send** and, when it is ready, **Publish**.

### Discard a draft

**1. Press Discard draft**

**Discard this draft?** opens: "The draft and its unsaved changes are deleted. The published version stays."

**2. Confirm**

You see **Draft discarded**: "The published version is the current one."

## Business rules

| ID | Rule |
| - | - |
| R-01 | There is only one draft per template at a time |
| R-02 | Saving does not change what is sent; only publishing does |
| R-03 | A draft can be saved with errors, but it cannot be published like that |
| R-04 | Leaving with unsaved changes through an in-app link or by closing the tab asks **Leave without saving?**; the browser Back button does not ask |
| R-05 | Base fields are validated with the channel contract: length limits, allowed values and required fields (marked with `*`) |

## States and messages

| State | What you see | Why | What to do |
| - | - | - | - |
| Read only | **Published version (read only)** chip next to the title | There is no draft | **Create draft** |
| No edit permission | "You can read the published version; your role cannot edit it." | `notification-template:edit` is missing | Ask for the Editor role |
| Unsaved changes | **Unsaved changes** chip | You edited and did not save | **Save draft** |
| Leaving with changes | **Leave without saving?**: "The draft has changes you did not save. If you leave, they are lost." | You try to leave | **Keep editing** or **Leave without saving** |

## Errors

| Message | Cause | Backend code | Support action |
| - | - | - | - |
| "The draft could not be created" | A draft already exists or the server failed | 409 or 5xx | Reload: if there is a draft, work on it |
| "The draft could not be saved" | Server or connection error | 5xx | Try again without leaving the screen |
| "The draft could not be discarded" | Server error | 5xx | Try again |
| "The template was not found or could not be loaded." | The event has no template for that channel, the channel does not exist or loading failed | 404 or 5xx | Open it from the event's **Channels** tab |

## Why it works this way

Separating the draft from the published version lets you work calmly: nobody gets a half-written text. Each
publication is also kept as a version, with its change note, so it can be compared and rolled back.

## Technical detail

| Aspect | Detail |
| - | - |
| Screen | `frontend/horizon-enterprise/app/components/screens/notification/templates/editor/notification-template-editor-screen.tsx`, on the route `frontend/horizon-enterprise/app/[locale]/notification/catalog/[id]/channels/[channel]/page.tsx` |
| Channel template | Comes from the event: `GET /api/v3/notification/catalog/event/{id}` › `channels[].template` |
| Old links | `/notification/templates/{id}` redirects to the new editor (`notification-template-redirect.tsx`); `/notification/templates` redirects to the catalog (`next.config.ts`) |
| Versions | `GET /api/v3/notification/template/{id}/version`; create `POST`, save `PUT .../version/{n}`, discard `DELETE .../version/{n}` |
| Channel contract | `GET /api/v3/notification/channel/{channel}/contract` (fields and limits) |
| Texts | `messages/{es,en}.json` › `modules.notification.editor` |
| Field names | `messages/{es,en}.json` › `modules.notification.editor.fields` (base and text fields of every channel; a field without a name shows its key) |

## FAQ and support cases

> [accordion] I saved and the customer still gets the old text
>
> Saving only updates the draft. You must **Publish** for sends to use it.

> [accordion] The Create draft button does not show
>
> Your role does not edit templates (Notification Operator), or a draft already exists: look for the **Draft** chip.

> [accordion] Where did the template list go?
>
> It was retired: every template belongs to a channel of an event. Find the event in the
> [catalog](https://docs.bbrands.io/enterprise/notifications/catalog/list.md) and open the template from its **Channels** tab. Old links still
> work: they open the new editor.

> [accordion] What are action.type or from\_email under a field?
>
> They are the technical keys of the fields, the names the channel contract and support use. The field name and its
> help above say what to fill in; see each channel's detail in [Channels](https://docs.bbrands.io/enterprise/notifications/channels/overview.md).

## Related and history

* [Languages](https://docs.bbrands.io/enterprise/notifications/templates/languages.md)
* [Variables](https://docs.bbrands.io/enterprise/notifications/templates/variables.md)
* [Publish](https://docs.bbrands.io/enterprise/notifications/templates/publish.md)

| Date | Change |
| - | - |
| 2026-11-11 | First version |
| 2026-11-12 | Fields show a translated name and help, with the technical key as a hint (#2193) |
| 2026-11-20 | The editor opens from the event's channels (`/notification/catalog/{event}/channels/{channel}`); the template list was retired (T-42) |


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