> 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/push/templates/editor.md).

# Template editor

Create and edit a push template.

> Write one push notification — title, body, tokens, and the iOS / Android options that decide how it looks on the device.

*Last updated 2026-09-11 · Applies to any project with the Push module enabled*

## Why it exists

A push notification is short, but it is not only text: the platform also wants to know how loud it is, how long to keep retrying, what to open when the user taps it, and what to do if an older notification about the same thing is still on screen. This screen collects all of that in one place, per language, so the campaign that uses the template only has to say "send this to these people".

## When you'd use it

* Writing the `Order shipped` message in English and Lithuanian, with the order number as a token.
* Adding a deep link so tapping the notification opens the order screen instead of the app's home.
* Setting a collapse id so three stock updates about the same product replace each other instead of stacking up.

## Where to find it

Push → Templates → **Create Template**, or click a template name · `/projects/<project>/push/templates/new` · `…/<id>/edit`

## How to create a template

Requires a role that carries `…:notifications:push:template:create` (or `…:template:update` when editing).

1. Open **Push → Templates → Create Template**. The page is titled **Add New Push Template**.
2. Fill **Template name** — e.g. `Notification when user registers`. It is required and cannot be changed after the template is created, so pick something you will still recognise in a year.
3. Write the **Title** — e.g. `Welcome @Model.FirstName to our app!` A word starting with `@Model.` is a token: a blank filled in per recipient at send time.
4. Write the **Body** (required) — e.g. `You have successfully registered to our app @Model.FirstName @Model.LastName!`
5. Open **Advanced settings** and pick a **Provider** if you do not want the environment default (required once integrations exist).
6. Optionally set the platform-specific options on the **IOS** and **Android** tabs.
7. Click **Create**.

**What "saved" looks like:** you return to the [templates list](/cloud/push/templates.md) with the new template in it, and its id (`tmpl_…`) becomes available to campaigns and triggers. In edit mode the button reads **Update**; **Cancel** discards.

## Fields

**General push notification settings**

| Field                             | What it means                                                                                                             | Example                                               |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| **Template language** (edit mode) | Switch between the project's languages. Each language holds its own title and body, stored as one `translations[]` entry. | `en`, `lt`                                            |
| **Template name** (required)      | The name in the list. Locked after creation.                                                                              | `Notification when user registers`                    |
| **Use pre-processing code**       | A switch that opens a Razor code editor for logic that runs before the message is rendered.                               | off                                                   |
| **Title**                         | The bold first line on the device. Tokens allowed.                                                                        | `Welcome @Model.FirstName to our app!`                |
| **Body** (required)               | The message itself. Tokens allowed.                                                                                       | `You have successfully registered, @Model.FirstName!` |

**Advanced settings**

| Field                                                   | What it means                                                                                        | Example                            |
| ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------- |
| **Provider** (required when integrations exist)         | The [push integration](/cloud/push/integrations.md) that delivers sends from this template.          | `Test Me`                          |
| **Priority**                                            | How urgent the message is for the platform: None, Default, Normal or High.                           | `Normal`                           |
| **TTL**                                                 | How long, in milliseconds, the provider keeps trying to deliver before giving up.                    | `15000`                            |
| **Pass extra information to push notification as JSON** | A switch that opens a JSON editor for a custom data payload your app receives with the notification. | `{ "orderId": "1234" }`            |
| **Metadata**                                            | Free key/value pairs stored with the message.                                                        | `campaign` = `spring`              |
| **Url**                                                 | A deep link opened when the user taps.                                                               | `myapp://notifications/@Model.nId` |
| **Collapse ID**                                         | Newer notifications with the same id replace older ones on the device.                               | `order-1234`                       |
| **File Integration**                                    | Reserved — the dropdown is not wired yet.                                                            | —                                  |

**Platform specific options** — two tabs. The provider has to support the option, so APNs ignores the Android tab and the other way round.

* **IOS** — Push Type (Alert, Background or Voip), Subtitle, App's bundle ID (e.g. `com.mycompany.myapp`), Group ID, Category, Badge Count (a number, e.g. `1`), Sound, Launch Image, and the **Content Available** checkbox.
* **Android** — Visibility (Private, Public or Secret), Group Id, Group message, Channel Id (e.g. `orders`), Restricted package name, Sound, Led Color, Light On Duration, Light off duration, Accent color, Small icon, Large icon, Vibration timings, and the **Sticky**, **Default light settings** and **Default vibration settings** checkboxes.

## Tokens and preview

Tokens use Razor syntax. `@Model.X` is your own token, bound to a value when the message is sent; reserved tokens such as `Project.Name`, `Initiator.User.Email` or `Recipient.User.FirstName` resolve by themselves. See [Tokens binding](/other-topics/tokens-binding.md).

Two endpoints back this while you type. **Get content tokens** walks the saved template and returns every token used in its translations — that is the list a campaign shows you to fill in. **Render push** takes one field (title, body or subtitle) plus the tokens you have bound so far and returns the finished text; if it finds a token you have not bound yet it answers `CM-ERRORS-TEMPLATES-008` with the missing names instead of rendering.

## Actions on a saved template

The **Test** button and the actions menu only work on a saved template with no unsaved changes.

* **Test** — opens a slide-over: pick the translation language and a provider, fill the template's tokens, and send one real notification. The test goes out as a one-recipient campaign to a **user** you choose.
* **Create Campaign** — opens [Create a Campaign](/cloud/push/campaigns/new.md) with this template already selected.
* **Archive** (only while the template is active) / **Unarchive** (only while it is archived) — retire or restore the template without deleting it.
* **Clone** — create a copy to edit.
* **See documentation** — opens the docs page.
* **Delete** — asks for confirmation first. Permanent.

{% hint style="warning" %}
The Test slide-over still carries the Email module's wording — the heading reads "Send Test Email" and the recipient box is labelled "Send test email to:" and styled as an email box, even though a push test targets a **user**, not an address. Tracked in testing-plan area **15-push**.
{% endhint %}

## Good to know

* **Body** is the only content field the platform insists on. A push with a body and no title is valid; a push with a title and no body is not.
* A template with no provider and no environment default cannot be sent — the campaign form will not let you press Send.
* **TTL** is in milliseconds, not seconds. `15000` means fifteen seconds.
* **Collapse ID** is a replace rule, not a de-duplicate rule: the newest message wins and the older one disappears from the device, even if the user never saw it.
* Deleting a template is refused while a scheduled campaign or a trigger still points at it. Archive it instead.
* The iOS and Android tabs are saved even when the current provider ignores them, so one template can serve both platforms.

## Do it in code

{% tabs %}
{% tab title="JavaScript / TypeScript" %}

```ts
const created = await norbix.hub.notifications.createPushTemplate({
  projectId: '<your-project-id>',
  templateName: 'Notification when user registers',
  communicationChannel: 'Transactional',
  translations: [
    {
      language: 'en',
      content: {
        title: 'Welcome @Model.FirstName to our app!',
        body: 'You have successfully registered, @Model.FirstName!',
      },
    },
  ],
});
```

{% endtab %}

{% tab title="Python" %}

```python
created = norbix.notifications.create_push_template(
    projectId="<your-project-id>",
    templateName="Notification when user registers",
    communicationChannel="Transactional",
    translations=[
        {
            "language": "en",
            "content": {
                "title": "Welcome @Model.FirstName to our app!",
                "body": "You have successfully registered, @Model.FirstName!",
            },
        }
    ],
)
```

{% endtab %}

{% tab title="Go" %}

```go
var created map[string]any
err := c.Hub.Notifications.CreatePushTemplate(ctx, map[string]any{
	"projectId":    "<your-project-id>",
	"templateName": "Notification when user registers",
	"translations": []map[string]any{
		{
			"language": "en",
			"content": map[string]any{
				"title": "Welcome @Model.FirstName to our app!",
				"body":  "You have successfully registered, @Model.FirstName!",
			},
		},
	},
}, &created)
```

{% endtab %}

{% tab title=".NET" %}
Not available yet — the .NET SDK has no push client methods. Call the REST endpoints below.
{% endtab %}
{% endtabs %}

Reference: [Create Push Template](/sdks-and-cli/notifications/push/create-push-template.md) · [Update Push Template](/sdks-and-cli/notifications/push/update-push-template.md) · [Get content tokens](/sdks-and-cli/notifications/push/get-push-message-content-tokens.md) · [Render push](/sdks-and-cli/notifications/push/render-push.md) CLI: `norbix push template <id>` shows one template; there is no create command yet.

## API reference

Endpoints: [Create](/api-reference/notifications/push/create-push-template.md), [Update](/api-reference/notifications/push/update-push-template.md), [Get](/api-reference/notifications/push/get-push-template.md), [Get content tokens](/api-reference/notifications/push/get-push-message-content-tokens.md), [Preview](/api-reference/notifications/push/preview-push-notification.md), [Render](/api-reference/notifications/push/render-push.md), [Archive](/api-reference/notifications/push/archive-push-template.md), [Un-archive](/api-reference/notifications/push/un-archive-push-template.md), [Clone](/api-reference/notifications/push/clone-push-template.md), [Delete](/api-reference/notifications/push/delete-push-template.md).

## Related

[Templates list](/cloud/push/templates.md) · [Create a Campaign](/cloud/push/campaigns/new.md) · [Integrations](/cloud/push/integrations.md) · [Tokens binding](/other-topics/tokens-binding.md)
