Prometheus - setting up a custom email template

Hi, I am not able to find any documentation on setting up a custom email template. The docs - https://prometheus.io/docs/alerting/notification_examples/ talk only about Slack notifications. Any pointers?

Yes:
https://prometheus.io/docs/alerting/configuration/#%3Cemail_config%3E

see the html and text configuration. There you can provide any templated email content

The link you have provided, though helpful in adding an inline template, does not talk about how to include an external html file as a template. There are some indications of how to do that in the example, but it’s by no means complete. The sample file it links to, also does not have an example.

For example, this is the relevant part of my config
receivers:

  • name: ‘sysadmin-emails’
    email_configs:
    • to: ‘…’
      send_resolved: true
      html: ‘{{ template “email.html” . }}’

templates:

  • ‘/etc/alertmanager/template/*.tmpl’

Here, I have an email.html in my template directory, but alertmanager complains about “no such template “email.html””

Also, it’s not clear how the tmpl file (and its location) should be tied to the html template’s location.