grafana icon indicating copy to clipboard operation
grafana copied to clipboard

Include current timestamp in Email subject line

Open gelicia opened this issue 1 year ago • 0 comments

Discussed in https://github.com/grafana/grafana/discussions/67092

Originally posted by shafeeq2207 April 24, 2023 Grafana version: v9.4.3 OS: Ubuntu 20.04

Hi

Im trying to include the current timestamp or incident start time in email subject line so that each email is received as separate mail instead of thread/group.

The mail subject template that i tried. {{ define “email.subject” }} {{ .Status | toUpper }} - {{ .CommonLabels.alertname }} {{ .Alerts.Firing.StartsAt.Format “Monday, 2 January 2006 at 3:04PM” }} {{ end }}

Subject that I actually see in mail for the above template: I’m getting only the “FIRING - TestAlert”

“{{ .Alerts.Firing.StartsAt.Format “Monday, 2 January 2006 at 3:04PM” }}” part of the template is just returning empty in actual mail subject alert.

Any help in this would be appreciated. Is there any another option to send each email as separate one?

gelicia avatar Feb 15 '24 18:02 gelicia