diff --git a/pkg/notifications/mail.go b/pkg/notifications/mail.go index f346313d1..da7a9fd05 100644 --- a/pkg/notifications/mail.go +++ b/pkg/notifications/mail.go @@ -31,7 +31,7 @@ type Mail struct { } type mailLine struct { - text string + Text string isHTML bool } @@ -71,7 +71,7 @@ func (m *Mail) Action(text, url string) *Mail { return m } -// Line adds a line of text to the mail +// Line adds a line of Text to the mail func (m *Mail) Line(line string) *Mail { return m.appendLine(line, false) } @@ -83,14 +83,14 @@ func (m *Mail) HTML(line string) *Mail { func (m *Mail) appendLine(line string, isHTML bool) *Mail { if m.actionURL == "" { m.introLines = append(m.introLines, &mailLine{ - text: line, + Text: line, isHTML: isHTML, }) return m } m.outroLines = append(m.outroLines, &mailLine{ - text: line, + Text: line, isHTML: isHTML, }) diff --git a/pkg/notifications/mail_render.go b/pkg/notifications/mail_render.go index f06de283e..062bd9236 100644 --- a/pkg/notifications/mail_render.go +++ b/pkg/notifications/mail_render.go @@ -35,12 +35,12 @@ import ( const mailTemplatePlain = ` {{ .Greeting }} {{ range $line := .IntroLines}} -{{ $line }} +{{ $line.Text }} {{ end }} {{ if .ActionURL }}{{ .ActionText }}: {{ .ActionURL }}{{end}} {{ range $line := .OutroLines}} -{{ $line }} +{{ $line.Text }} {{ end }}` const mailTemplateHTML = ` @@ -50,9 +50,9 @@ const mailTemplateHTML = `
-This is a line
-This line contains a link
+This line contains a link
And another one
@@ -148,7 +152,7 @@ And one more, because why not? + style="position: relative;Text-decoration:none;display: block;border-radius: 4px;cursor: pointer;padding-bottom: 8px;padding-left: 14px;padding-right: 14px;padding-top: 8px;width:280px;margin:10px auto;Text-align: center;white-space: nowrap;border: 0;Text-transform: uppercase;font-size: 14px;font-weight: 700;-webkit-box-shadow: 0 3px 6px rgba(107,114,128,.12),0 2px 4px rgba(107,114,128,.1);box-shadow: 0 3px 6px rgba(107,114,128,.12),0 2px 4px rgba(107,114,128,.1);background-color: #1973ff;border-color: transparent;color: #fff;"> The action