I wonder if it relates to this in 0.24.0 changelog?

** [BUGFIX] Fix the default HTML email template (`email.default.html`) to 
match with the canonical source. #2798*

I haven't tried it, but what happens if you set this?

html: "{{/*empty*/}}"

Sadly, I suspect you will get a multipart/alternative mail with empty html 
section.

The source code in notify/email/email.go 
<https://github.com/prometheus/alertmanager/blob/v0.24.0/notify/email/email.go#L290-L314>
 
says:

        if len(n.conf.HTML) > 0 {

However if the parameter is being set by default to '{{ template 
"email.default.html" . }}' then it could negate this.

On Tuesday, 15 November 2022 at 15:04:49 UTC Mike H wrote:

> Hi all,
> Hoping someone can help or offer some insight.
> Upgraded from Alertmanager v0.20.0 to v0.23.0
> We have a Monitoring Events system that can only auto process text based 
> emails which it uses to generate Incident tickets.
> In v0.20.0 we just set html:'' , this no longer seems to be working on 
> v0.23.0 or v0.24.0
> by default Alertmanager adds in html: '{{ template "email.default.html" . 
> }}'.
> We send 2 emails, 1 with a custom html template to the k8s team and one 
> with a custom text template to the monitoring system:
> Config is as follows:
> global:
>   smtp_auth_password: **************
>   smtp_auth_username: *****@mycompany.com
>   resolve_timeout: 5m
>   smtp_from: k8s.aler...@mycompany.com
>   smtp_smarthost: auth-forwarder.mycompany.com:25
>
> receivers:
>   - name: email-receiver
>     email_configs:
>     - headers:
>         subject: '{{ template "__subject" . }}'
>       html: '{{ template "email.custom.html" . }}'
>       send_resolved: false
>       to: k8s-...@mycompany.com
>
>   - name: ITSM-receiver
>     email_configs:
>       - to: monitori...@mycompany.com
>         send_resolved: false
>         headers:
>           subject: '{{ template "__subject" . }}'
>         html: ''
>         text: '{{ template "email.custom.txt" . }}'
>
> route:
>   group_by:
>   - alertname
>   group_interval: 5m
>   group_wait: 30s
>   receiver: email-receiver
>   repeat_interval: 2h
>
>
>   routes:
>   - receiver: 'email-receiver'
>     matchers:
>       - alertname=".+"
>       - severity="warning|critical"
>   - receiver: 'ITSM-receiver'
>     matchers:
>       - alertname=".+"
>       - severity="warning|critical"
> templates:
> - /etc/alertmanager/configmaps/alert-template/*.tmpl
>
>
> Has the option of using html:''  been removed from the latest versions or 
> is there a way around this.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/ce30de1a-451a-4050-91a0-35dc337a9d84n%40googlegroups.com.

Reply via email to