# Problem with e-mail notifications

**URL:** <https://community.grafana.com/t/problem-with-e-mail-notifications/118586>\
**Category:** Alerting\
**Tags:** templating, alerting\
**Created:** [April 4, 2024, 11:15am UTC](https://community.grafana.com/t/problem-with-e-mail-notifications/118586 "2024-04-04T11:15:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Puebloo](https://avatars.discourse-cdn.com/v4/letter/p/d9b06d/32.png) [@Puebloo](https://community.grafana.com/u/Puebloo)\
**Post date:** [April 4, 2024, 11:15am UTC](https://community.grafana.com/t/problem-with-e-mail-notifications/118586/1 "2024-04-04T11:15:51Z")

</div>

Hello,  
I’m trying to set up multiple alerts (sent by email) for servers, and I have an issue with the message that is being sent. I’m getting the message below, and to be honest, it’s completely unclear for other users:

**Value:** [var=‘B0’ metric=‘value’ labels={agent.name=.SERWER1, metricId=3} value=0.978], [var=‘B1’ metric=‘value’ labels={agent.name=.SERWER2, metricId=3} value=0.965], [var=‘B2’ metric=‘value’ labels={agent.name=.SERWER3, metricId=3} value=0.9500000000000001], [var=‘B3’ metric=‘value’ labels={agent.name=.SERWER4, metricId=3} value=0.9540000000000001], [var=‘B4’ metric=‘value’ labels={agent.name=.SERWER5, metricId=3} value=0.907]  
**Labels:**

- alertname: RAM USAGE IN TIME
- grafana\_folder: Production

I need to get something like this instead:

The server SERWER1 has exceeded 90% of RAM usage. Current RAM usage used is 98%  
The server SERWER2 has exceeded 90% of RAM usage. Current RAM usage used is 97%  
The server SERWER3 has exceeded 90% of RAM usage. Current RAM usage used is 95%  
The server SERWER4 has exceeded 90% of RAM usage. Current RAM usage used is 96%  
The server SERWER4 has exceeded 90% of RAM usage. Current RAM usage used is 91%

I tried to find the solution in other threads, but most of them don’t have complete information about what should be done.  
Im using Grafana [v9.2.2] and metricbeat

---

<div class="post-metadata">

**Author:** ![pepecano](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/pepecano/32/40676_2.png) [@pepecano](https://community.grafana.com/u/pepecano)\
**Post date:** [October 30, 2024, 6:14pm UTC](https://community.grafana.com/t/problem-with-e-mail-notifications/118586/2 "2024-10-30T18:14:34Z")

</div>

Hi @Puebloo, we recently updated the documentation and examples for implementing custom notification templates.

1 - You’ll need to [template an annotation](https://grafana.com/docs/grafana/latest/alerting/alerting-rules/templates/#template-annotations), for example the `summary` annotation like in this example:

```auto
The server {{ $labels.instance }} has exceeded 90% of RAM usage. 
Current RAM usage used is {{humanizePercentage $values.A.Value }}

```

2 - Then, create a [custom notification template](https://grafana.com/docs/grafana/latest/alerting/configure-notifications/template-notifications/) that display the summary for all the alerts in the notification.

```auto
{{ define "print_summary" -}}
{{ range .Alerts -}}
{{.Annotations.summary}}
{{ end -}}
{{ end -}}

```

3 - Finally, configure the email contact point to use your custom template as detailed in [Select a notification template for a contact point](https://grafana.com/docs/grafana/latest/alerting/configure-notifications/template-notifications/manage-notification-templates/#select-a-notification-template-for-a-contact-point).
