{{ $numberOfFiringInstance := (len .Alerts.Firing) }} {{ $numberOfResolvedAlerts := (len .Alerts.Resolved) }}
{{ if $numberOfFiringInstance }} {{ $numberOfFiringInstance }} firing alert {{ $numberOfFiringInstance| plural "instance" "instances" }} {{ end }} {{ if and $numberOfFiringInstance $numberOfResolvedAlerts }}  and  {{ end }} {{ if $numberOfResolvedAlerts }} {{ $numberOfResolvedAlerts }} resolved alert {{ $numberOfResolvedAlerts| plural "instance" "instances" }} {{ end }}
{{ if eq (.GroupLabels.SortedPairs.Names | join ",") "alertname,grafana_folder" }} {{ else }} {{ end }}

📁 {{ .GroupLabels.grafana_folder }} › {{ .GroupLabels.alertname }}

📁 Grouped by 

{{ range .GroupLabels.SortedPairs }} {{ .Name }}={{ .Value }} {{ end }}
{{ if .Message }}
{{ range $line := (splitList "\n" .Message) }} {{ $line }}
{{ end }}
{{ else }}{{ if .Alerts.Firing }}

🔥 {{ .Alerts.Firing | len }} firing instances

{{ range .Alerts.Firing }}
{{ .Labels.alertname }}
{{ if gt (len .GeneratorURL) 0 }} {{ end }}
{{ if .ImageURL }} {{ end }}{{ if .EmbeddedImage }}
{{ end }}
{{ if .Annotations.summary }} {{ end }}{{ if .Annotations.description }} {{ end }}
Summary
{{- .Annotations.summary -}}
Description
{{ range $line := (splitList "\n" .Annotations.description) }} {{ $line }}
{{ end }}
{{ if .Values }}
Values
{{ range $refID, $value := .Values }} {{ $refID }}={{ $value }}  {{ end }}
{{ end }}
{{ if .Labels.SortedPairs }} {{ end }}{{ if .Annotations.SortedPairs }} {{ end }}
Labels
{{ range .Labels.SortedPairs }} {{ end }}
{{ .Name }} {{ .Value }}
Annotations
{{ range .Annotations.SortedPairs }} {{ end }}
{{ .Name }} {{ .Value }}
{{ if .SilenceURL }} {{ end }}{{ if .Annotations.runbook_url }} {{ end }}{{ if .DashboardURL }} {{ end }}{{ if .PanelURL }} {{ end }}
Observed {{ ago .StartsAt }} before this notification was delivered, at {{ .StartsAt }}
{{ end }}{{ end }}{{ if .Alerts.Resolved }}

✅ {{ .Alerts.Resolved | len }} resolved instances

{{ range .Alerts.Resolved }}

Resolved

{{ .Labels.alertname }}
{{ if gt (len .GeneratorURL) 0 }} {{ end }}
{{ if .ImageURL }} {{ end }}{{ if .EmbeddedImage }}
{{ end }}
{{ if .Annotations.summary }} {{ end }}{{ if .Annotations.description }} {{ end }}
Summary
{{- .Annotations.summary -}}
Description
{{ range $line := (splitList "\n" .Annotations.description) }} {{ $line }}
{{ end }}
{{ if .Values }}
Values
{{ range $refID, $value := .Values }} {{ $refID }}={{ $value }}  {{ end }}
{{ end }}
{{ if .Labels.SortedPairs }} {{ end }}{{ if .Annotations.SortedPairs }} {{ end }}
Labels
{{ range .Labels.SortedPairs }} {{ end }}
{{ .Name }} {{ .Value }}
Annotations
{{ range .Annotations.SortedPairs }} {{ end }}
{{ .Name }} {{ .Value }}
{{ if .SilenceURL }} {{ end }}{{ if .Annotations.runbook_url }} {{ end }}{{ if .DashboardURL }} {{ end }}{{ if .PanelURL }} {{ end }}
Observed {{ ago .StartsAt }} before this notification was delivered, at {{ .StartsAt }}
{{ end }}{{ end }}{{ end }}
© {{ now | date "2006" }} Grafana Labs. Sent by Grafana v{{ .BuildVersion }}.