Rich Message Templates
Configure per-output message templates so notifications carry just the fields that matter.
PayloadRelay can render rich, channel-native messages on Slack, Discord, Microsoft Teams, and Telegram outputs instead of dumping the full request body as text. Templates are configured per output, so the same incoming webhook can fan out a long-form Slack block alongside a one-line Telegram alert.
Enabling a template
- Open the endpoint, switch to the Destinations tab and expand the output you want to customize.
- Open the Message template card and toggle Use custom message template.
- Fill in Title and/or Body using the placeholder syntax below. At least one of the two must be non-empty.
- (Optional) Pick a Color for Slack attachments / Discord embeds / Microsoft Teams theme. Telegram does not support color theming.
- Toggle Include "View in PayloadRelay" link to add a footer link that takes the recipient straight to the endpoint activity log.
- Save the endpoint. Live preview is rendered as you type.
Placeholder syntax
{{ body.path.to.value }} JSON dot-path into the request body
{{ headers.X-Event }} case-insensitive header lookup
{{ query.token }} query parameter value
{{ body }} entire JSON body, serializedUnknown placeholders resolve to an empty string — they never fail delivery.
Helpers
Pipe the value through one of these helpers to format it:
| Helper | Effect |
|---|---|
default('n/a') | Substitute the literal when the value is null or blank. |
upper / lower | Change case. |
iso_date | Parse epoch seconds, epoch millis, or ISO‑8601 input and emit ISO‑8601 UTC. |
truncate(n) | Truncate to n characters with …; values above 8000 are clamped at render time (save-time validation also rejects oversized helper arguments). |
strip_html | Remove HTML tags. |
Examples:
{{ body.event | upper }}
{{ body.timestamp | iso_date }}
{{ body.message | truncate(140) }}
{{ body.user.name | default('anonymous') }}Channel-specific behaviour
- Slack — Renders as a Block Kit
attachments[].blockspayload with aheaderblock (title), asectionblock withmrkdwn(body), and an optional link section. Body supports Slack mrkdwn (*bold*,_italic_,<url|text>). - Discord — Renders as an embed with
title,description, optionalurland aView in PayloadRelayfield. Color is converted from#RRGGBBto the decimal value Discord requires. - Microsoft Teams — Renders as a
MessageCardwiththemeColor,title,text, and an optionalOpenUriaction. - Telegram — Renders as
parse_mode: "HTML"with<b>title</b>followed by the escaped body and an optional<a>link. Output is capped at 4096 characters per Telegram's API limit.
Limits and validation
- Title: 512 characters.
- Body: 8000 characters (rendered output). The
truncate(n)helper is capped at the same 8000-character maximum. - Color: must match
#RRGGBB. - Only
body.,headers., andquery.namespaces are accepted; templates referencing anything else (e.g.{{ secrets.token }}) are rejected with a 400 at save time. - Unknown helpers are rejected with a 400.
Falling back to the default behaviour
Disable the template toggle to revert to the historic behaviour: the entire incoming payload is dumped as text into the channel. Existing outputs that have never had a template configured continue to work exactly as before.