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

# Creating & Managing Templates

> Step-by-step guide to creating, editing, testing, and managing notification templates in SuprSend.

## Create a template

There are two ways to create a template:

* **From the Templates page** — go to **Templates** in the sidebar and click **+ New Template**. You'll link it to a workflow later.
* **From a workflow** — click **Create Template** inside a delivery node in the [workflow builder](/docs/workflows). The template is automatically linked to that workflow and its name and slug are pre-filled from the workflow and node names. This is the fastest path when building a new notification from scratch.

<Steps>
  <Step title="Click + New Template">
    From the Templates page or a workflow node, open the creation modal.

    <Frame caption="Create Template — Name and Slug">
      <img src="https://mintcdn.com/suprsend/sGhtraHJZNmyh1Op/images/docs/templates-create-modal-new.png?fit=max&auto=format&n=sGhtraHJZNmyh1Op&q=85&s=c2f9aaf5e8bbcadf750fde8f89ff3030" width="982" height="692" data-path="images/docs/templates-create-modal-new.png" />
    </Frame>

    Enter a **Name** (display label, changeable later) and a **Slug** (the identifier your [workflow](/docs/workflows) uses to reference this template — auto-derived from the name, **cannot be changed after creation**). Renaming the template later doesn't affect the slug, so existing workflows keep working.
  </Step>

  <Step title="Pick channels">
    Select the channels you want to send on. You can add more channels later by clicking the **+** tab in the editor, or remove a channel from the channel's three-dot menu.

    <Frame caption="Select channels">
      <img src="https://mintcdn.com/suprsend/sGhtraHJZNmyh1Op/images/docs/templates-channel-selection.png?fit=max&auto=format&n=sGhtraHJZNmyh1Op&q=85&s=4d0f7e26cbe05701f096133a4fd56adb" width="1024" height="561" data-path="images/docs/templates-channel-selection.png" />
    </Frame>
  </Step>
</Steps>

***

## Write your content

The editor opens for your first channel. Each channel has its own editor with a live device preview on the right. Click the channel tabs at the top to switch between them.

* **View mode** (default) — shows the published version, read-only.
* **Edit mode** — click **Edit** to open the draft. Content auto-saves as you type. Live traffic is never affected until you commit. If you exit without committing, your draft is saved — you can come back and pick up where you left off.

For channel-specific fields and editor guides, see:

<CardGroup cols="3">
  <Card title="Email" icon="envelope-dot" iconType="solid" href="/docs/email-template">
    Designer, HTML, or plain text.
  </Card>

  <Card title="SMS" icon="comment-sms" iconType="solid" href="/docs/sms-template">
    Single text field. DLT for India.
  </Card>

  <Card title="WhatsApp" icon="whatsapp" iconType="solid" href="/docs/whatsapp-template">
    Header, body, footer, buttons.
  </Card>

  <Card title="Android Push" icon="android" iconType="solid" href="/docs/android-push-template">
    Title, body, image, buttons.
  </Card>

  <Card title="iOS Push" icon="apple" iconType="solid" href="/docs/ios-push-template">
    Title, body, image, action URL.
  </Card>

  <Card title="Web Push" icon="mobile-screen" iconType="solid" href="/docs/web-push-template">
    Title, body, image, buttons.
  </Card>

  <Card title="In-App Inbox" icon="inbox-full" iconType="solid" href="/docs/in-app-inbox-template">
    Cards with avatar, buttons, expiry.
  </Card>

  <Card title="Slack" icon="slack" iconType="solid" href="/docs/slack-template">
    Text or Block Kit (JSONNET).
  </Card>

  <Card title="MS Teams" icon="windows" iconType="solid" href="/docs/ms-teams-template">
    Markdown or Adaptive Card (JSONNET).
  </Card>
</CardGroup>

### The Variables panel

The left panel has a `{}` tab — the **Variables panel**. This is where you set up all the data your template uses. It powers auto-suggestions, the live preview, and the test flow. Set this up before writing variables in your content.

<Frame caption="Variables panel">
  <img src="https://mintcdn.com/suprsend/sGhtraHJZNmyh1Op/images/docs/templates-variables-panel-new.png?fit=max&auto=format&n=sGhtraHJZNmyh1Op&q=85&s=68813266ff2dab7184310f2d5b7d7411" width="724" height="1024" data-path="images/docs/templates-variables-panel-new.png" />
</Frame>

**Input Payload**

This is the data your workflow trigger sends — order details, event info, URLs, etc. Paste a sample JSON that matches the shape of your actual trigger payload. For example:

```json theme={"system"}
{
  "order_id": "ORD-1234",
  "order": {
    "total": "$49.99",
    "address": { "city": "San Francisco" }
  },
  "tracking_url": "https://yourapp.com/track/ORD-1234"
}
```

Use these in your template as `{{order_id}}`, `{{order.address.city}}`, `{{{tracking_url}}}` (triple braces for URLs to avoid escaping `&`, `?`, `=`).

Toggle **Enable batching** to preview [batched](/docs/batch)/[digest](/docs/digest) content — this adds `$batched_events` and `$batched_events_count` to your data context.

You can also click **Pre-fill from last workflow run** (if the template is linked to a workflow) to auto-populate with real data from the most recent trigger.

**Recipient**

Search for a user by name, email, or distinct ID. Their profile properties load into `$recipient` — accessible in your template as:

* `{{$recipient.name}}` — user's name
* `{{$recipient.email}}` — user's email
* `{{$recipient.phone}}` — user's phone number
* `{{$recipient.distinct_id}}` — user's unique ID
* Any custom property you've set on the user profile

This is the person who **receives** the notification. In the live preview, selecting a recipient renders the template with their actual data — so you can see exactly what they'd receive.

<Info>
  Use `$recipient` in templates, not `$user`. Both refer to the same data, but `$recipient` is the standard.
</Info>

**Tenant**

Select a [tenant](/docs/tenants) from the dropdown. Its properties load into `$brand` — accessible as:

* `{{$brand.brand_name}}` — tenant's display name
* `{{$brand.logo}}` — tenant's logo URL
* `{{$brand.primary_color}}` — brand colour (used in email Tenant blocks)
* `{{$brand.properties.address}}` — custom tenant properties (address, support email, etc.)
* `{{$brand.$hosted_preference_url}}` — hosted unsubscribe/preference page link
* `{{$brand.$embedded_preference_url}}` — embedded preference widget link

If your template uses tenant branding (logo in email header, brand name in SMS, etc.), selecting a tenant in the preview shows you exactly how that tenant's notifications look.

<Warning>
  Use `$brand` for tenant data in templates — not `$tenant`. The `$tenant` namespace is not exposed to templates.
</Warning>

**Actor**

The actor is the person who **performed the action** that triggered the notification — separate from the recipient. For example: "Alice commented on Bob's post" — Alice is the `$actor`, Bob is the `$recipient`.

* `{{$actor.name}}` — actor's name
* `{{$actor.email}}` — actor's email

Actor data is only available when your workflow trigger includes an `actor`. If no actor is passed, `$actor` variables render as empty.

### Using variables in content

Once your data is set up, type `{{` in any text field — a dropdown shows all available variables grouped by source (Input Payload, Recipient, Actor, Tenant). Pick one, and it renders instantly in the preview. Variables with missing values are highlighted in **red**.

In the Email Design Editor, use the **Merge Tags** button in the toolbar instead.

For advanced logic (conditionals, loops, date formatting), see [Handlebars Helpers](/docs/handlebars-helpers). For Slack and MS Teams (JSONNET syntax), see [JSONNET Templates](/docs/jsonnet-templates).

The **live preview** on the right updates as you type. Select different Recipients and Tenants in the Variables panel to see how the template renders for different users and brands.

***

## Commit

Click **Commit** in the top bar to publish your draft. Add an optional description. All future workflow triggers immediately use the new content.

For **WhatsApp** and **SMS (DLT)**, committing puts the version into **Approval Pending** — it goes live only after vendor approval.

### Using the template in a workflow

Once committed, the template is ready to be used. Add it to a [workflow](/docs/workflows) delivery node by referencing its **slug**. Every time the workflow triggers, SuprSend renders the template with the trigger payload and sends it to the recipient. You can copy the slug from the clipboard icon next to the template name.

***

## Test

After committing, send a real notification to a real device to verify everything looks right end-to-end.

Click the **Test** button in the top-right corner.

<Info>
  **Need a test user?** You need a user with at least one channel identity (email, phone number, device token). Create one from the [Users page](https://app.suprsend.com/users), via [API](/docs/users), or ask the AI copilot in the dashboard to create one.
</Info>

<Tabs>
  <Tab title="Test one channel">
    1. Pick the **Channel** (e.g., Email, SMS).
    2. Enter a **Recipient** (email or distinct ID).
    3. Optionally pick a **Notification Category** — determines which [vendor](/docs/vendors) config is used (e.g., transactional vs promotional SMS vendor).
    4. Optionally pick a **Tenant** — loads that tenant's branding into `$brand` and selects the matching tenant variant. Leave blank to use defaults.
    5. Click **Send Test**.

    <Frame caption="Test one variant on one channel">
      <img src="https://mintcdn.com/suprsend/sGhtraHJZNmyh1Op/images/docs/templates-test-variant.png?fit=max&auto=format&n=sGhtraHJZNmyh1Op&q=85&s=ca3bc482c8822c95e735077f110e59ba" width="781" height="1024" data-path="images/docs/templates-test-variant.png" />
    </Frame>
  </Tab>

  <Tab title="Test all channels">
    1. Enter a **Recipient** — the panel shows every channel that user has identities for.
    2. Check the channels to include.
    3. Optionally pick **Category** and **Tenant**.
    4. Click **Send Test**.

    <Frame caption="Test all channels at once">
      <img src="https://mintcdn.com/suprsend/sGhtraHJZNmyh1Op/images/docs/templates-test-group.png?fit=max&auto=format&n=sGhtraHJZNmyh1Op&q=85&s=83e09091a59e4582b985f5119358a477" width="789" height="1024" data-path="images/docs/templates-test-group.png" />
    </Frame>
  </Tab>
</Tabs>

After sending, go to **[Logs](/docs/logging)** to check delivery status. If a variable was missing or a channel failed to render, you'll see the exact error there.

<Warning>
  **WhatsApp** and **SMS (DLT)** templates must be committed and approved before you can test.
</Warning>

***

## Version history

Click the **History** tab (clock icon) in the left panel to see all published versions — who committed, when, and what changed per channel.

<Frame caption="Version history">
  <img src="https://mintcdn.com/suprsend/sGhtraHJZNmyh1Op/images/docs/templates-version-history-new.png?fit=max&auto=format&n=sGhtraHJZNmyh1Op&q=85&s=881170676dcd2b9fe420ff8f378bed19" width="1024" height="204" data-path="images/docs/templates-version-history-new.png" />
</Frame>

To rollback: click a previous version → **Rollback**. It becomes the live version. Newer versions are not deleted.

***

## Variants

Every template starts with a **default** variant. That's enough for most use cases. Add more variants only when you need different content for different audiences:

* **Languages** — a Spanish variant for Spanish-speaking users, Hindi for Hindi. SuprSend auto-selects based on the recipient's preferred language. See [Multi-lingual Templates](/docs/multi-lingual-template).
* **Tenants** — Uber's users see Uber branding, Acme's users see Acme's. One template serves all tenants.
* **Payload conditions** — show different content based on trigger data (e.g., `plan == "pro"` gets a premium message).

Non-default variants are evaluated in order — the first one whose conditions match is sent. If nothing matches, the **default** variant (always at the top) is sent as the fallback. Name them descriptively: `uber-en`, `acme-es`, `default-hi`.

Full guide: [Template Variants](/docs/template-variants).

***

## Import content

Click the **Import** button (arrow icon) in the editor toolbar to copy content from:

* **This template** — another variant (e.g., copy default English into a new Spanish variant, then translate).
* **Other templates** — any template in your workspace. Pick a variant and preview before importing.

<Frame caption="Import content">
  <img src="https://mintcdn.com/suprsend/sGhtraHJZNmyh1Op/images/docs/templates-editor-toolbar-import-new.png?fit=max&auto=format&n=sGhtraHJZNmyh1Op&q=85&s=2079b5942e206d19222418e62611f7fe" width="674" height="398" data-path="images/docs/templates-editor-toolbar-import-new.png" />
</Frame>

Imported content is a one-time copy — the source and copy are independent after import.

***

## Clone and promote

Click **Clone Template** to copy the entire template (all channels, variants, content) to the same or a different workspace — e.g., from Staging to Production.

<Frame caption="Clone Template">
  <img src="https://mintcdn.com/suprsend/sGhtraHJZNmyh1Op/images/docs/templates-clone-modal.png?fit=max&auto=format&n=sGhtraHJZNmyh1Op&q=85&s=427baf2906841e71d1f663ba7ece4260" width="1024" height="707" data-path="images/docs/templates-clone-modal.png" />
</Frame>

***

## Managing templates

**Metadata** — click the info icon next to the template name to edit Name, Description, and Tags. The Slug is immutable after creation.

**Finding templates** — the Templates listing page shows all templates with status, channels, linked workflow, and last updated. Use **Filters and Sort** to narrow by channel, tag, status, or templates you edited. The **Approvals** tab shows pending WhatsApp/DLT approvals.

**Archive** — archive unused templates from the overflow menu. Cannot be recovered.

**API and CLI** — manage templates programmatically via the [Template Management API](/reference/list-templates-v2) or [CLI](/reference/cli-template-overview).
