From 899257ee2362da7b8bc5ea14183c12137515a26b Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Tue, 20 Oct 2015 09:22:36 +0200 Subject: [PATCH] Add proper styling of mail template --- template/default.tmpl | 204 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 181 insertions(+), 23 deletions(-) diff --git a/template/default.tmpl b/template/default.tmpl index 2faf4ffc..5293a43b 100644 --- a/template/default.tmpl +++ b/template/default.tmpl @@ -28,32 +28,190 @@ Content-Type: text/html; charset=UTF-8 {{ end }} {{ define "email.default.html" }} -

{{ len .Alerts }} alert(s) for {{ .GroupLabels }}

+{{/* + +The following is the readable HTML code for the mail template. It has to be inlined, e.g. by +http://templates.mailchimp.com/resources/inline-css/. + +The inlined output is inserted after this comment. + +---- + + + + {{ range .Alerts }} -
- {{ .Status }}
-
- Labels
-
    -{{ range $label, $value := .Labels }} -
  • {{ $label }}: {{ $value }}
  • -{{ end }} -
+
+ + {{ end }} + +
+ + + + +
+

{{ len .Alerts }} alert{{ if gt (len .Alerts) 1 }}s{{ end }} for {{ .GroupLabels }}

+
+
+ +
+ + + + +
+
    + {{ range $label, $value := .Labels }} +
  • + {{ $label }} + {{ $value }} +
  • + {{ end }} +
+
-
- Annotations
-
    -{{ range $label, $value := .Annotations }} -
  • {{ $label }}: {{ $value }}
  • -{{ end }} -
+ +
+ + + + +
+
    + {{ range $label, $value := .Annotations }} +
  • + {{ $label }} + {{ $value }} +
  • + {{ end }} +
+
+
+ +
+ +--- + +Template end, the following is the inlined version of the above. + +*/}} + + + + + {{ range .Alerts }} + + + + {{ end }} + +
+ + + + +
+

{{ len .Alerts }} alert{{ if gt (len .Alerts) 1 }}s{{ end }} for {{ .GroupLabels }}

+
+
+ +
+ + + + +
+
    + {{ range $label, $value := .Labels }} +
  • + {{ $label }} + {{ $value }} +
  • + {{ end }} +
+
-
- + +
+ + + + +
+
    + {{ range $label, $value := .Annotations }} +
  • + {{ $label }} + {{ $value }} +
  • + {{ end }} +
+
+
+ +
{{ end }} \ No newline at end of file