Grafana alerting is not using the alert template that we specified on contact point configuration. We want to display the below information on email to our users
- Alert Title should be in email subject
- Alert message should be in email body
- Grafana renderer screenshot should come next to alert message
- Hyperlinks to view Alerts and Panel page should come next to alert screenshots
Below are the attempts we tried so far.
In grafana contact point configuration page
- If we leave the message box blank, we are receiving the alert notifications like below
Alert Notification
- If we add {{ template “email.message” . }} in message box, we are receiving the alert notifications like below
Alert Notification
- If we add the below template lines in message box, we are receiving the alert notifications like below
{{ define "__teams_text_alert_list" }}{{ range . }}
{{ range .Annotations.SortedPairs }} - {{ .Name }} = {{ .Value }}
{{ end }}
{{ if gt (len .GeneratorURL) 0 }}Source: [{{ .GeneratorURL }}]({{ .GeneratorURL }})
{{ end }}{{ if gt (len .SilenceURL) 0 }}Silence: [{{ .SilenceURL }}]({{ .SilenceURL }})
{{ end }}{{ if gt (len .DashboardURL) 0 }}Dashboard: [{{ .DashboardURL }}]({{ .DashboardURL }})
{{ end }}{{ if gt (len .PanelURL) 0 }}Panel: [{{ .PanelURL }}]({{ .PanelURL }})
{{ end }}
{{ end }}{{ end }}
Alert Notification
Can anyone help us to get the message format properly?
Thanks in advance