I'm switching from Grafana 8 with legacy alerting to Grafana 10.3 with the new unified alerting system. I'd like the email notifications to have buttons to access the dashboard and panel linked to the alert, just like the old alerting system. I know this is possible since I managed to do it on accident when testing notification templates a few months ago. However, due to multiple changes in the configuration since then, I can't remember what the configuration was and the buttons completely disappeared from my email notifications. Looking at the grafana documentation and old versions of the configuration did not help either. I'm trying to get the following in my email notifications :
Here's my notification template :
{{- define "email.message_alert" -}}
{{ .Labels.alertname }} has value of {{ .Values.B }}
{{- end -}}
{{ define "email.message" }}
There are {{ len .Alerts.Firing }} firing alert(s), and {{ len .Alerts.Resolved }} resolved alert(s)
{{ if .Alerts.Firing -}}
Firing alerts:
{{- range .Alerts.Firing }}
- {{ template "email.message_alert" . }}
{{- end }}
{{- end }}
{{ if .Alerts.Resolved -}}
Resolved alerts:
{{- range .Alerts.Resolved }}
- {{ template "email.message_alert" . }}
{{- end }}
{{- end }}
{{ end }}