# Changing email template

**URL:** <https://forums.percona.com/t/changing-email-template/20543>\
**Category:** PMM 2.x\
**Created:** [March 13, 2023, 11:43am UTC](https://forums.percona.com/t/changing-email-template/20543 "2023-03-13T11:43:59Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cihan\_Tunali](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/cihan_tunali/32/4574_2.png) [@Cihan\_Tunali](https://forums.percona.com/u/Cihan_Tunali)\
**Post date:** [March 13, 2023, 11:43am UTC](https://forums.percona.com/t/changing-email-template/20543/1 "2023-03-13T11:43:59Z")

</div>

Hello all,

When using emails if an alert occurs, I need to change URL of PMM inside the mail. I changed PMM url from PMM settings but it still continue to send [localhost](https://localhost/graph/alerting/list) at notifications. How can I change this?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [March 14, 2023, 1:30pm UTC](https://forums.percona.com/t/changing-email-template/20543/2 "2023-03-14T13:30:36Z")

</div>

Hello @Cihan_Tunali,  
You will have to go into the docker container and edit `grafana.ini` inside `/srv/` to change the template. Be aware that if you upgrade PMM, you will lose these changes. Our dev teams are aware of this feature request and are working on a better solution.

---

<div class="post-metadata">

**Author:** ![Cihan\_Tunali](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/cihan_tunali/32/4574_2.png) [@Cihan\_Tunali](https://forums.percona.com/u/Cihan_Tunali)\
**Post date:** [March 20, 2023, 1:42pm UTC](https://forums.percona.com/t/changing-email-template/20543/3 "2023-03-20T13:42:55Z")

</div>

Thank you @matthewb , I am using PMM via OVF template. So which state should i add/modify to achieve my goal?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [March 20, 2023, 2:30pm UTC](https://forums.percona.com/t/changing-email-template/20543/4 "2023-03-20T14:30:39Z")

</div>

You’ll have to find the grafana.ini config file, probably in /opt/ or in /etc/ and edit the template.

---

<div class="post-metadata">

**Author:** ![Cihan\_Tunali](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/cihan_tunali/32/4574_2.png) [@Cihan\_Tunali](https://forums.percona.com/u/Cihan_Tunali)\
**Post date:** [March 20, 2023, 2:40pm UTC](https://forums.percona.com/t/changing-email-template/20543/5 "2023-03-20T14:40:59Z")

</div>

I found it but I could not find the value need to be change/add.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [March 20, 2023, 2:52pm UTC](https://forums.percona.com/t/changing-email-template/20543/6 "2023-03-20T14:52:37Z")

</div>

A google search showed me to edit ‘/usr/share/grafana/public/emails/alert\_notification.html’  
[https://sbcode.net/grafana/email-alert-template/](https://sbcode.net/grafana/email-alert-template/)

---

<div class="post-metadata">

**Author:** ![Cihan\_Tunali](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/cihan_tunali/32/4574_2.png) [@Cihan\_Tunali](https://forums.percona.com/u/Cihan_Tunali)\
**Post date:** [March 20, 2023, 5:35pm UTC](https://forums.percona.com/t/changing-email-template/20543/7 "2023-03-20T17:35:43Z")

</div>

Actually, you enlighten my way. I found the solution but not with your way.

- edit grafana.ini file  
vim /etc/grafana/grafana.ini

- add below line into [server] section  
root\_url = [https://urlofpmm.com](https://urlofpmm.com)

- restart grafana  
supervisorctl restart grafana

Now this is “the” solution. Thanks!

---

<div class="post-metadata">

**Author:** ![steve.hoffman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/steve.hoffman/32/66_2.png) [@steve.hoffman](https://forums.percona.com/u/steve.hoffman)\
**Post date:** [March 20, 2023, 6:01pm UTC](https://forums.percona.com/t/changing-email-template/20543/8 "2023-03-20T18:01:22Z")

</div>

Sorry, I’m late to the party…I think you can (and should) do the following:

Login to PMM as an admin  
Click the Gear Icon in the lower left corner → click Setttings → click Advanced Settings  
You should see the “Public Address”. You can set this to the URL you want alerts to be formed with which will not only work for alerts but this also becomes needed for other services (DBaaS monitoring comes to mind) to be able to pre-determine your PMM url for pushing metrics back.

The only concern with changing the /etc/grafana/grafana.ini is that it’s possible it will get overwritten in certain upgrade scenarios.

---

<div class="post-metadata">

**Author:** ![Cihan\_Tunali](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/cihan_tunali/32/4574_2.png) [@Cihan\_Tunali](https://forums.percona.com/u/Cihan_Tunali)\
**Post date:** [March 21, 2023, 8:18am UTC](https://forums.percona.com/t/changing-email-template/20543/9 "2023-03-21T08:18:26Z")

</div>

Hi @steve.hoffman  
Yeap, first I tried to change the value from Advanced settings but it did not change anything, I don’t know maybe you already aware about it.

I got information about changing the grafana.ini file will be replace if I update PMM. Thank you again.

---

<div class="post-metadata">

**Author:** ![steve.hoffman](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/steve.hoffman/32/66_2.png) [@steve.hoffman](https://forums.percona.com/u/steve.hoffman)\
**Post date:** [March 24, 2023, 2:33pm UTC](https://forums.percona.com/t/changing-email-template/20543/10 "2023-03-24T14:33:52Z")

</div>

hmmm…I will try again and open a ticket!

to combat the file being overwritten in a future upgrade… you can pass the following env variable if/when you do a container upgrade:  
`-e GF_SERVER_ROOT_URL=my.domain.com`
