prometheus / alertmanager

Prometheus Alertmanager
https://prometheus.io
Apache License 2.0
6.63k stars 2.15k forks source link

Package for generating emails #683

Closed fabxc closed 6 years ago

fabxc commented 7 years ago

HTML emails are extremely painful. Currently we have a template that somewhat works, but not really. We also have no proper support for an alternative multipart sending HTML and plain text versions. Even less so for keeping both in sync.

There's a package now, that seems to do a great job at solving this problem: https://github.com/matcornic/hermes

We should evaluate switching to this one.

brian-brazil commented 7 years ago

We'll always need to allow users to directly control the raw content of their emails, so this would be an optional extra at most.

fabxc commented 7 years ago

Tend to agree with optional, wouldn't be sure about "optional extra at most" – practically speaking, this is probably the better choice in 99% of the cases.

brian-brazil commented 7 years ago

I'd guess nearer 50-80%, lots of email will be going to ticketing systems which won't care for fancy formatting.

prologic commented 6 years ago

This is also painful as currently many mail servers reject email from alertmanager because of MIME_MA_MISSING_TEXT

brian-brazil commented 6 years ago

We support text now. If users want to use tools to generate their HTML and make it fancy they are free to do so.

prologic commented 6 years ago

Yes :)

For future readers:

+    text: |
+      Summary: {{ range .Alerts }}{{ .Annotations.summary }} {{ end }}
+
+      Description: {{ range .Alerts }}{{ .Annotations.description }} {{ end }}
+
+      RunBook: http://wiki.intern.mills.io/Alert{{ .GroupLabels.alertname }}