Source: https://gitlab-test-org.docs.pageloop.ai/template-creation-discord

# Discord Templates

When you add the **Discord** channel to a template, the **Create your Discord Template** screen opens. The Preview on the right shows how the message looks in Discord.

![](assets/discordcreate-v-3-editor.png)

## Add the content

Under **Content**, choose how you want to write the message body.

#### Text

Use **Text** to send a simple message. Type your message and use the toolbar above the field for bold, italic, strikethrough and code formatting. You can add placeholders within `{{ }}`.

#### JSON

Use **JSON** to send the message body as JSON. You can add placeholders within `{{ }}`.

![](assets/discordcreate-v-2-json.png)

## Placeholders

Below the **Channels** section on the left, you can find placeholders. Placeholders are denoted by **`{{ }}`** or **Handlebars**. Click a placeholder to open a pop-up window where you can define its parameters. See the comprehensive guide on [Handlebars](https://handlebarsjs.com/guide/).

> [!TIP]
>
> **Did you know?**
>
> You can use a period (.), underscore (\_) or hyphen (-) within the handlebars. Try it now!

> [!WARNING]
>
> You cannot use only numeric values as placeholder keys.

## How to add dynamic content

You can add dynamic content to your templates using one of the four options below:

- [Placeholders](./template-dynamic-content#placeholders)
- [System Variables](./template-dynamic-content#system-variables)
- [Handlebars](./template-dynamic-content#handlebars)
- [Components](./template-dynamic-content#components)

## How to test a Discord template

Use this feature to test a template thoroughly before including it in any Notification Event. This ensures early detection and resolution of any potential issues, for a seamless user experience.

1. Click **Run Test** at the top right of the template. The **Test Discord template** pop-up opens.

   ![](assets/discordcreate-v-3-test-modal.png)
2. From the dropdown, choose **Discord** and enter the recipient details on Discord, or choose **Distinct ID** and enter it. **Make sure to enter the distinct\_id of a Test User profile.**
3. Select a Discord integration that is already configured in Fyno. If you see **No Discord provider integration found**, click **Integrate Provider** to set one up first.
4. **Auto-fill empty placeholders** (optional, AI assistance): If your template has placeholders with no sample values, Fyno can fill them using AI so you can test the message. Click **Yes** to let Fyno fill sample values for the empty placeholders.
5. Click **Run Test** to send the message to the recipient with the selected integration. You see the success or failure message along with a link to the Sent Logs.

## Save and go live

Click **Save** to save the template as a **Test** version. You can save different versions of the template this way. Use **Go Live** when you are ready to move your template to the **Live** version.

> [!NOTE]
>
> If template approvals are enabled in your workspace, **Go Live** needs an additional approval step. Choose from your designated approvers, who review and authorize the template changes. See [Approval flow](./approval-flow) for the steps.
