# \[Grafana 8\] \[Unified Alerting\] Email notification template redifinition

**URL:** <https://community.grafana.com/t/grafana-8-unified-alerting-email-notification-template-redifinition/60236>\
**Category:** Alerting\
**Tags:** unified-alerting, alert-notifications, smtp, email, alerting\
**Created:** [February 4, 2022, 2:48pm UTC](https://community.grafana.com/t/grafana-8-unified-alerting-email-notification-template-redifinition/60236 "2022-02-04T14:48:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![whatsupbros](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/whatsupbros/32/21225_2.png) [@whatsupbros](https://community.grafana.com/u/whatsupbros)\
**Post date:** [February 4, 2022, 2:48pm UTC](https://community.grafana.com/t/grafana-8-unified-alerting-email-notification-template-redifinition/60236/1 "2022-02-04T14:48:46Z")

</div>

> What Grafana version and what operating system are you using?

Grafana v8.3.4 on Linux RPM

> **What** are you trying to achieve?

I need to redefine the standard “Email notification” template for Unified Alerting within Grafana User Interface.

> **How** are you trying to achieve it?

I am trying to use “[Message Templating](https://grafana.com/docs/grafana/latest/alerting/unified-alerting/message-templating/)” functionality for this.

> What happened?

Email notification template seem to be impossible to be customized via Grafana User Interface, which is a huge frustration. As a result:

- Not clear at all how to redefine email notification “ **Subject** ”
- Not clear at all how to redefine email notification “ **Body** ”, when you do not have direct access to Grafana server, which is 99% of the cases, when we speak about big enough organization (it seems to still be possible to replace the template HTML file)
- It is not possible to have different HTML templates for different alerts, which use email as the notification channel.
- Default email notification template is **too general** and sometimes is completely useless.

> What did you **expect** to happen?

That notification templates are easily configurable, within Grafana UI.

That different “contact points”/“alerts” may be associated with different alert templates.

> Did you follow any online instructions? If so, what is the URL?

I used only official Grafana docs, which are not in the ideal state, to be honest:

- [Notification templating | Grafana documentation](https://grafana.com/docs/grafana/latest/alerting/unified-alerting/message-templating/)
- [https://grafana.com/docs/grafana/latest/alerting/unified-alerting/message-templating/template-data/](https://grafana.com/docs/grafana/latest/alerting/unified-alerting/message-templating/template-data/)

So, is there any way to redefine email notification “subject” and “body”?  
I suppose the only currently available way to redefince email “body” is to replace the `ng_alert_notification.html` file? But still, how do I change the subject?

Is it going to be added to Grafana UI, so HTML templates are also editable there?

---

<div class="post-metadata">

**Author:** ![l1243](https://avatars.discourse-cdn.com/v4/letter/l/f475e1/32.png) [@l1243](https://community.grafana.com/u/l1243)\
**Post date:** [February 7, 2022, 8:53am UTC](https://community.grafana.com/t/grafana-8-unified-alerting-email-notification-template-redifinition/60236/2 "2022-02-07T08:53:31Z")

</div>

same question for me

Do you find a solution?

---

<div class="post-metadata">

**Author:** ![whatsupbros](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/whatsupbros/32/21225_2.png) [@whatsupbros](https://community.grafana.com/u/whatsupbros)\
**Post date:** [February 7, 2022, 9:18am UTC](https://community.grafana.com/t/grafana-8-unified-alerting-email-notification-template-redifinition/60236/3 "2022-02-07T09:18:08Z")

</div>

No, I haven’t found any solution yet.

Changing the “html” template by changing the file on Grafana server is also very painful for us, because we don’t usually have direct access to the infrastructure. Also, there’s no way to define different templates for different alerts or teams with changing the ‘html’ file.

So, we’re still looking for suggestions from Grafana Labs and the community…

---

<div class="post-metadata">

**Author:** ![l1243](https://avatars.discourse-cdn.com/v4/letter/l/f475e1/32.png) [@l1243](https://community.grafana.com/u/l1243)\
**Post date:** [February 7, 2022, 9:48am UTC](https://community.grafana.com/t/grafana-8-unified-alerting-email-notification-template-redifinition/60236/4 "2022-02-07T09:48:31Z")

</div>

I switched back to the old legacy alerting.

There you can edit more stuff

---

<div class="post-metadata">

**Author:** ![whatsupbros](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/whatsupbros/32/21225_2.png) [@whatsupbros](https://community.grafana.com/u/whatsupbros)\
**Post date:** [February 7, 2022, 9:55am UTC](https://community.grafana.com/t/grafana-8-unified-alerting-email-notification-template-redifinition/60236/5 "2022-02-07T09:55:23Z")

</div>

Both Legacy Alerting and Unified Alerting lack proper customizations for the email alert notifications. Legacy Alerting is even less configurable and there you cannot even control what values will go to the alert, and in which format. That’s basically the reason why they implemented [all these functions for the value formatting](https://grafana.com/docs/grafana/latest/alerting/unified-alerting/alerting-rules/alert-annotation-label/#template-functions).

So, for us both options have their crucial downsides, but we also already think about switching back, since **in Legacy Alerting it is at least much more transparent “what will go to notification subject” and “what will go to the body”**.

It looks like Grafana Labs wanted to add more customizations to the alerts, but in fact they broke the simplicity, and some functionality was completely destroyed…

---

<div class="post-metadata">

**Author:** ![ehuggins](https://avatars.discourse-cdn.com/v4/letter/e/a6a055/32.png) [@ehuggins](https://community.grafana.com/u/ehuggins)\
**Post date:** [February 8, 2022, 8:17pm UTC](https://community.grafana.com/t/grafana-8-unified-alerting-email-notification-template-redifinition/60236/6 "2022-02-08T20:17:40Z")

</div>

Your assessment is correct.  
Unified alerting broke Email Template functionality.  
There has been quite a bit of discussion on GitHub regarding a way to fix the issue.  
[Some custom email templates stopped working after migration to Grafana Alerting · Issue #42946 · grafana/grafana (github.com)](https://github.com/grafana/grafana/issues/42946)

---

<div class="post-metadata">

**Author:** ![whatsupbros](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/whatsupbros/32/21225_2.png) [@whatsupbros](https://community.grafana.com/u/whatsupbros)\
**Post date:** [November 2, 2022, 9:09am UTC](https://community.grafana.com/t/grafana-8-unified-alerting-email-notification-template-redifinition/60236/7 "2022-11-02T09:09:27Z")

</div>

No good news so far for this topic?
