How to customize {{ .ValueString }} values in email alert HTML template

Hi everyone,

I have been modifying the “ng_alert_notification.html” file in order to send custom email alerts upon the creation of my alert rules. However, I would like to know whether it is possible to extract only the labels when using {{ .ValueString }}.
I tried different combinations but none of them are working…
1) First example:
{{with $values.B.Value }
{{ range $k, $v := . }}
{{ . | reReplaceAll metric='.*' value={.*} labels= “”}}

2) Second example:
{{with .ValueString}}
{{ . | reReplaceAll metric='.*' value={.*} labels= “”}}

Here is an example of the metric label I want to display:
metric value

Thanks in advance for your help !

@malmenaydetristan if you’re still looking for an answer to this the first example is the right strategy but $values.B.Value will only contain the metric value. To see the labels {{$labels}} or iterate over labels and values you would use just $values

Check out the improved docs page here: