Skip to main content

Template Editor

The template editor lets you create and customize message templates with a visual editor and live previews for each supported platform.

Creating a Template

  1. Navigate to TemplatesCreate Template
  2. Enter a name
  3. The editor opens with a default template structure

Editor Layout

The template editor has two main panels:

  • Left: Platform Tabs + Config Editor — switch between platform tabs (Discord, Slack, Telegram, Default) and edit the JSON config for each with syntax highlighting
  • Right: Live Preview — see a rendered preview for the active platform tab as you type

Platform Tabs

Each tab represents a platform variant within a v2 multi-platform template:

TabFormatDescription
DiscordEmbed configStandard Discord embed with title, description, fields, color
SlackBlock Kit JSONNative Slack Block Kit blocks for rich Slack messages
TelegramHTML templateHTML string for Telegram's HTML parse mode
DefaultEmbed configFallback used when no platform-specific variant is configured

At delivery time, Dispatch selects the variant matching the destination type. If no matching variant is set for that platform, the Default variant is used.

tip

You don't need to configure all platforms. Configure only the tabs you need — leave the rest empty and Dispatch will fall back to auto-formatting or the Default tab.

Discord Tab

The Discord tab uses the standard embed config format:

{
"title": "{{.Meta.EventType}}",
"description": "Event from {{.Body.repository.full_name}}",
"color": 5763719,
"fields": [
{
"name": "Action",
"value": "{{.Body.action}}",
"inline": true
}
],
"footer": "Dispatch",
"thumbnail": "{{.Body.sender.avatar_url}}",
"timestamp": true
}

The live preview renders a Discord embed matching what will be delivered to Discord destinations.

Slack Tab

The Slack tab accepts a slack_blocks array containing native Block Kit blocks. All string values inside the blocks support template expressions:

{
"slack_blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "{{upper .Meta.EventType}}"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Repository*\n{{.Body.repository.full_name}}"
},
{
"type": "mrkdwn",
"text": "*Action*\n`{{.Body.action}}`"
}
]
}
]
}

Telegram Tab

The Telegram tab accepts a telegram_html string that supports template expressions and is sent with Telegram's HTML parse mode:

{
"telegram_html": "<b>{{upper .Meta.EventType}}</b>\n\nRepo: <code>{{.Body.repository.full_name}}</code>\nAction: <code>{{.Body.action}}</code>\n\nBy <b>{{.Body.sender.login}}</b>"
}

Supported HTML tags: <b>, <i>, <u>, <s>, <code>, <pre>, <a href="...">, <tg-spoiler>.

Variable Discovery

The editor helps you discover available template variables:

  • A Variables panel shows all available .Meta variables (event ID, event type, endpoint ID, timestamp)
  • If recent events exist for linked endpoints, the editor shows actual payload paths from real event data so you can click to insert them

This panel is available across all platform tabs.

Assigning Templates

Templates are assigned per endpoint-destination link:

  1. Go to Sources
  2. Click on an endpoint
  3. Edit the destination link
  4. Select a template from the dropdown

You can also set up routing rules on a link to use different templates based on event field values. See Templates for details.