#if, #unless, #each, #with) and nothing custom, so there’s no join, upper, or eq. The examples below stick to what’s actually available.
Variables
The template runs against the same object documented on the Payload page. Use dot-notation for nested fields.Escaping
Templates render with HTML escaping off, so{{monitor.name}} outputs the raw value. You don’t need triple-stash.
The trade-off is that nothing JSON-escapes either. A value containing a " will break a templated JSON body, and there’s no built-in helper to escape it. Keep templated string fields to values you control, like a monitor name you named yourself. If a body could contain arbitrary user text with quotes, send the canonical payload instead, which is always valid JSON.
Joining an array
There’s nojoin helper, so iterate with #each and suppress the trailing separator with @last:
fra1, iad1, sgp1.
Worked examples
Slack-compatible body
For a Slack incoming webhook with more control than the native Slack channel gives you:Slack template
Datadog event
Push incidents into Datadog’s event stream:Datadog template
Minimal internal alert
When your ticketing system just needs a subject and a link:Minimal template
Status page publisher
Re-broadcast to a status-page tool that accepts a webhook:Statuspage template
Branch by event type
There’s no string-equality helper, so don’t compareevent directly. Branch on the field that distinguishes the events instead. incident.resolved_at is set only on resolve:
Troubleshooting
My receiver got the default payload, not my template
My receiver got the default payload, not my template
A template that fails to compile or render doesn’t block the alert. Tallwatch logs the error, falls back to the canonical JSON payload, and the dispatch is marked
sent. So a broken template shows up as “my receiver got the default shape.” Re-test with Send test alert and fix the template.My receiver returns 400 'invalid JSON'
My receiver returns 400 'invalid JSON'
A value in a string field contained a
", \, or control character and broke the JSON, since templates don’t escape. Keep arbitrary user text out of templated JSON string fields, or fall back to the canonical payload.A field renders empty
A field renders empty
Handlebars renders a missing value as an empty string, not
undefined. If you literally see the word undefined in the output, something on your receiver side is stringifying it. Check what Tallwatch sent with a test alert first.`failing_regions` is empty on resolve
`failing_regions` is empty on resolve
Expected: on resolve, every region agrees the monitor is up, so the array is empty. Guard region-dependent parts:
When not to template
If your receiver accepts the canonical payload, leave the field blank:- One less thing to update when the payload gains a field.
- The canonical body is always valid JSON; a template can produce broken JSON.
- A predictable body makes the dispatch history easier to read.