Sample Notification Templates
This section provides ready-to-use examples of notification templates to help you quickly format alert messages.
Label
Description
Notification Template Examples β Code Snippets and Email Previews
{{ define "Notification-email" -}}
{{ range .Alerts -}}
{{- $alertCode := index .Labels "alert_code" -}}
{{- $alertName := index .Labels "alertname" -}}
{{- $dataset := index .Labels "dataset" -}}
{{- $summary := index .Annotations "summary" -}}
{{- $table := index .Labels "table" -}}
{{- $severity := index .Labels "severity" -}}
{{- $name := index .Labels "alertName" -}}
{{- $description := index .Annotations "description" -}}
{{- if and $alertCode $alertName $description $severity -}}
{{- if not (or (match "DatasourceNoData" $alertName) (match "DatasourceError" $alertName)) }}
{{- if eq $severity "critical" }}
π¨ {{ title $severity }} Alert: {{ $alertName }}
{{- else if eq $severity "warning" }}
β οΈ {{ title $severity }} Alert: {{ $alertName }}
{{- end }}
{{- if and $dataset (ne $dataset "all") }}
π¦ Dataset: "{{ $dataset }}"
{{- end }}
{{- if $table }}
π Table: "{{ $table }}"
{{- end }}
π Alert Code: {{ $alertCode }}
π Impact Summary: {{ $summary }}
π For more assistance reach out to administrative support or refer https://docs.obsrv.ai/how-tos/alerts-and-notifications/alerts-and-recommended-actions
{{- end }}
{{- end -}}
{{ end -}}
{{ end }}

Last updated
