diff --git a/changelog/unreleased/fix-email-templates.md b/changelog/unreleased/fix-email-templates.md new file mode 100644 index 00000000000..614fafc30b8 --- /dev/null +++ b/changelog/unreleased/fix-email-templates.md @@ -0,0 +1,5 @@ +Bugfix: Fix email templates white spaces & new lines + +Email templates now contain no unwanted white spaces & new lines if .CallToAction is nil + +https://github.com/owncloud/ocis/pull/10884 diff --git a/services/notifications/pkg/email/templates/html/email.html.tmpl b/services/notifications/pkg/email/templates/html/email.html.tmpl index f36f0766693..92c6f48715e 100644 --- a/services/notifications/pkg/email/templates/html/email.html.tmpl +++ b/services/notifications/pkg/email/templates/html/email.html.tmpl @@ -11,8 +11,10 @@ {{ .Greeting }}

{{ .MessageBody }} - {{if ne .CallToAction "" }}

- {{ .CallToAction }}{{end}} + {{- if .CallToAction }} +

+ {{ .CallToAction }} + {{- end }} diff --git a/services/notifications/pkg/email/templates/text/email.text.tmpl b/services/notifications/pkg/email/templates/text/email.text.tmpl index b571692672d..609117d58fd 100644 --- a/services/notifications/pkg/email/templates/text/email.text.tmpl +++ b/services/notifications/pkg/email/templates/text/email.text.tmpl @@ -1,9 +1,11 @@ {{ .Greeting }} {{ .MessageBody }} -{{if ne .CallToAction "" }} +{{- if .CallToAction }} + {{ .CallToAction }} -{{end}} +{{- end }} + --- ownCloud - Store. Share. Work.