Change Email Alert Template in Kubernetes Environment

Hi,
I am using Grafana to monitor my own project in kubernetes. I want to send an email notification when an alert is triggered. To do that I have create a configmap which is grafana-config.yaml whose content is like following:

**root@latif:~# cat grafana-config.yaml**
# Source: robomotion/templates/grafana-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: grafana-ini-config
data:
  grafana.ini: |-
    [server]
    root_url = /api/monitoring
    serve_from_sub_path = true

    [auth.anonymous]
    enabled = true

    [auth]
    disable_login_form = true

    [security]
    allow_embedding = true

    [smtp]
    enabled=true
    host=host:port
    user=my@emailadress.com
    password=**********
    from_name=Robomotion Alert Manager
    from_address= alert@robomotion.io

When I use kubectl apply -f grafana-config.yaml and restart grafana pod, I can see the mails with the given settings. But in the received mails, there is a specific template to Grafana. I want to edit the template. When I search it, there is an html file for email template in public folder. How can I edit the html file in kubernetes environment and apply the new html file for sending the emails with my edited templates

Thanks…

Hi @latif1

This isn’t the greatest answer but I do believe that email templating is available with the new Unified Alerting feature that was released with Grafana 8. That feature is still behind a feature-toggle until it is a bit more stable, but I would check it out:

docker run -p 3000:3000 --name=grafana -e “GF_FEATURE_TOGGLES_ENABLE=ngalert” grafana/grafana:8.0.2