The ability to modify the email subject comes from upstream grafana and here’s the docs with the info you’re after starts. By using this PR as a guide, I was able to get some of the data using the test button for the contact point based on these template variables here
Any of:
{{ .Status }} {{ .CommonAnnotations }} {{ .GroupLabels }} worked using the test button but the moment I tried {{ .severity }} or {{ .Labels.severity }} or {{ $Labels.severity }} it would send the test but not render the subject in the email and I see the following in the /srv/logs/grafana.logs file: level=warn msg="failed to template email message" err="template: :1:11: executing \"\" at <.labels.severity>: can't evaluate field labels in type *channels.ExtendedData"
which makes sense because it’s a test email not a real alert with labels added to it…my problem is that I broke something somewhere else in my setup so I can’t get a real email to generate to see if they would work on a legitimate firing alert but may be enough to get you pointed in the right direction.
Thanks for the help. I tried the following options {{ .severity }} or {{ .Labels.severity }} or {{ $Labels.severity }} with genuine error, but still I am getting subject like empty or (no subject).