How to share notification wording across alert rules
A notification template is a named title and body that many alert rules can use. Edit it once and every rule that uses it sends the new wording.
Create a template
Open Settings > Notification templates and choose New template. Fill in:
- Title and Body (fired), using the same
{{placeholder}}syntax as a rule's own message (for example[{{status}}] {{rule_name}}). Unknown placeholders are rejected when you save. - Body (resolved), optional. Used for resolved notifications. Empty reuses the fired body.
- Per-channel bodies, optional. Replace the fired body for one channel type, for example a short text for Telegram and a long one for Email.
Use it on a rule
In the rule form, pick the template under Notification template. The picker appears once at least one template exists. Text you write under Customize the notification message still overrides the template, field by field.
Set a default
Turn on Use as the default template for one template. It applies to every rule that picks none. Only one template can be the default. With no default and no template picked, rules keep each channel's built-in wording.
Delete a template
A template that rules still use can't be deleted. The error lists the rules; pick another template on them first.
Manage templates from the CLI or Terraform
flare alert-templates create pager-short --title '[{{status}}] {{rule_name}}' \
--body '{{rule_name}}: {{value}} in the last {{window}}' \
--channel-body 'Telegram={{rule_name}} {{status}}' --default true
flare alert-templates list
flare alert-templates update <ID> --body '{{message}}'
flare alert-templates delete <ID> --yes
update fetches the existing template and changes only the options you pass; pass an empty value such as --body '' to clear a text. --channel-body TYPE=TEXT is repeatable and replaces all existing per-channel bodies. delete prompts unless --yes, and is refused while rules use the template.
With the Flare Terraform / OpenTofu provider, a rule picks a template by name:
resource "flare_alert_template" "short" {
name = "pager-short"
title_template = "[{{status}}] {{rule_name}}"
body_template = "{{rule_name}}: {{value}} in the last {{window}}"
channel_bodies = { Telegram = "{{rule_name}} {{status}}" }
}
resource "flare_alert_rule" "errors" {
# ...
notification_template = flare_alert_template.short.name
}
Renaming a template updates it in place, and rules keep pointing at it. terraform import flare_alert_template.short <id-or-name> adopts an existing one.
Export and import
flare alerts export records a rule's template by name, and import looks the
name up on the target instance. Create the template there first, or the rule is
reported as an error.
The API is /api/alert-templates. See
ADR-0148 for
the design.
Last updated: