Rich Message Templates
Configure one message template for each destination.
A message template is text that uses values from the incoming request. PayloadRelay can use a template to create a message for Slack, Discord, Microsoft Teams, or Telegram. You configure the template for each destination. One incoming webhook can thus create a different message for each channel.
Enabling a template#
- Open the endpoint. Select the
Outputstab and expand the destination to change. - Open the
Message templatecard. Turn onUse custom message template. - Enter a
Title, aBody, or both. At least one field must contain text. - Optional: Select a
Colorfor a Slack attachment, a Discord embed, or the Microsoft Teams theme. Telegram does not support a color theme. - Optional: Turn on
Include "View in PayloadRelay" linkto add a link to the endpoint activity log. - Save the endpoint. The live preview updates while 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 as textA missing value in a permitted namespace becomes an empty string. PayloadRelay rejects an unknown namespace and an unknown helper when you save the template.
Helpers#
Use one of these helpers after the pipe to format a value:
| Helper | Effect |
|---|---|
default('n/a') | Use the literal value when the value is null or blank. |
upper / lower | Change the case. |
iso_date | Parse epoch seconds, epoch milliseconds, or an ISO‑8601 input, and write ISO‑8601 UTC. |
truncate(n) | Cut the value to n characters, and add …. The maximum is 8000. |
strip_html | Remove the HTML tags. |
Examples:
{{ body.event | upper }}
{{ body.timestamp | iso_date }}
{{ body.message | truncate(140) }}
{{ body.user.name | default('anonymous') }}Channel-specific behavior#
- Slack: PayloadRelay sends a Slack message with a top-level
textfallback and a Block Kitattachments[].blockspayload. The payload contains aheaderblock for the title, onesectionblock or more withmrkdwnfor the body, and an optional link section. PayloadRelay divides a long body to stay in the Slack section text limits. The body supports Slack mrkdwn such as*bold*,_italic_, and<url|text>. - Discord: PayloadRelay sends an embed with
title,description, an optionalurl, and aView in PayloadRelayfield. It converts#RRGGBBinto the decimal color value that Discord needs. Discord limits an embed description to 4000 characters. PayloadRelay cuts a body that is longer than 4000 characters, for the Discord delivery and the preview. - Microsoft Teams: PayloadRelay sends a
MessageCardwiththemeColor,title,text, and an optionalOpenUriaction. A legacy Incoming Webhook connector shows the link action as a button. Teams Workflows can ignore the button when it posts the card. - Telegram: PayloadRelay sends
parse_mode: "HTML"with<b>title</b>, the escaped body, and an optional<a>link. Telegram limits the message to 4096 characters.
Limits and validation#
- Title: 512 characters.
- Body: 8000 characters in the message after the template processing. The
truncate(n)helper has the same 8000-character limit. - You can save a Discord template body to the general 8000-character limit. The Discord embed description has a limit of 4000 characters.
- Color: the value must match
#RRGGBB. - PayloadRelay accepts the
body.,headers., andquery.namespaces only. You cannot save a template that uses a different namespace, such as{{ secrets.token }}. - You cannot save a template that uses an unknown helper.
Falling back to the default behavior#
To use the default behavior, disable the template control. The default Slack
message puts the incoming payload in the Slack text field. A destination with
no configured template continues to give the same result.