Changing Alert Emails from Dark Mode

Hi all,

Update from 9.4.3 to 9.5.1 few weeks ago and had Alert Emails not sending

I editted the ng_alert_notification.html before to suit light mode and then updated and got
“Got 2 out of expected 3 arguments” or similar error, didn’t have time to check the missing piece yet, will do

But my question is, apart from editing colour settings of headings and body in html is there a way to change to lightmode alerts

Also I have light mode on for Grafana in general so it must just default the email to dark mode

I’m having the same issue too - would like all of my alerts – email, Teams to be light mode. Dark mode plays havoc when trying to forward to someone - results in black text on black background. There must be a simple switch, or similar, rather than having to hack up ng_alert_notifications. @georgerobinson

1 Like

I’m afraid just dark mode is supported at present. If forwarding emails from Grafana is important, and images are not required, I’d recommend telling Grafana to send plain text emails instead.

For example:

You have 1 firing alert(s), and 0 resolved alert(s) for alertname=Test, grafana_folder=Test Folder

(1) FIRING
-----------

Labels: alertname=Test, grafana_folder=Test Folder
Summary: This is a summary
Description: This is a description

Go to the Alerts page: http://grafana.staged-by-discourse.com/alerting/list?alertState=firing&view=state


Sent by Grafana v10.0.2 (c) 2023 Grafana Labs

If using plain text emails I would recommend upgrading to the latest version of Grafana 10 as I’ve done work in Grafana 10.0.1 to 1. improve the default template and 2. support templating of plain text emails.

Here is an example of how to turn on plain/text emails in Grafana’s ini file:

[emails]
welcome_email_on_sign_up = false
templates_pattern = emails/*.html, emails/*.txt
content_types = text/plain
1 Like

Thanks George, will help anyway!

I actually went ahead and changed colours in the HTML email as below to what could work with normal bright mode, and dark text etc

No Guarantee this will work after major updates

file is renamed from .html just found the colours 000000 and se to FFFFFF and vice versa, reloaded page to find other issues

ng_alert_notification.json (95.9 KB)

Hi! Just a heads up that Grafana has added light mode and it will be available in 10.2. Email: Light theme email templates by gillesdemey · Pull Request #72398 · grafana/grafana · GitHub