Customization of Grafana unified alert is not working as expected

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

  1. Alert Title should be in email subject
  2. Alert message should be in email body
  3. Grafana renderer screenshot should come next to alert message
  4. 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