{{ define "telegram.custom.message" }}
{{ range .Alerts }}
{{ if eq .Status "firing"}}🔥{{ .Labels.alertname }}🔥{{ else }}👌{{ .Labels.alertname }}👌{{ end }}
Labels:{{ range $key, $value := .Labels }}{{ if ne $key "alertname" }}
- {{ $key }}: {{ reReplaceAll "(<|>)+" "" $value }}{{ end }}{{ end }}
Annotations:{{ range $key, $value := .Annotations }}
- {{ $key }}: {{ reReplaceAll "(?s)(\\s+)LABELS = (.*)" "" $value }}{{ end }}
Start: {{ .StartsAt.Local.Format "02/01/2006 15:04:05 MST" }}{{ if eq .Status "resolved"}}
Ended: {{ .EndsAt.Local.Format "02/01/2006 15:04:05 MST" }}{{ end }}
{{ end }}
{{ end }}