From 3520431e1f0e0eacbdd7b50e1ea4b75be39e34fe Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Thu, 27 Jun 2024 13:38:48 +0200 Subject: [PATCH] fixed the email template when the description was marked as a link --- changelog/unreleased/fix-email-template.md | 7 +++++++ services/notifications/pkg/email/composer.go | 4 ++-- services/notifications/pkg/service/service_test.go | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 changelog/unreleased/fix-email-template.md diff --git a/changelog/unreleased/fix-email-template.md b/changelog/unreleased/fix-email-template.md new file mode 100644 index 0000000000..d072bac1d6 --- /dev/null +++ b/changelog/unreleased/fix-email-template.md @@ -0,0 +1,7 @@ +Bugfix: Fixed the email template + +Fixed the email template when the description was marked as a link. + + +https://github.com/owncloud/ocis/pull/9484 +https://github.com/owncloud/ocis/issues/8424 diff --git a/services/notifications/pkg/email/composer.go b/services/notifications/pkg/email/composer.go index b3f33f0bbb..097ff3631e 100644 --- a/services/notifications/pkg/email/composer.go +++ b/services/notifications/pkg/email/composer.go @@ -89,6 +89,6 @@ func callToActionToHTML(s string) string { if strings.TrimSpace(s) == "" { return "" } - s = strings.TrimSuffix(s, "{{ .ShareLink }}") - return `` + s + `` + s = strings.TrimSuffix(s, "{ShareLink}") + return s + `{ShareLink}` } diff --git a/services/notifications/pkg/service/service_test.go b/services/notifications/pkg/service/service_test.go index afd7e51c4c..2bdcb3651d 100644 --- a/services/notifications/pkg/service/service_test.go +++ b/services/notifications/pkg/service/service_test.go @@ -315,7 +315,7 @@ https://owncloud.com

Dr. O'reilly has shared "<script>alert('secrets of the board');</script>" with you.

- Click here to view it: files/shares/with-me + Click here to view it: files/shares/with-me @@ -384,7 +384,7 @@ https://owncloud.com

Dr. O'reilly has invited you to join "<script>alert('secret space');</script>".

- Click here to view it: f/spaceid + Click here to view it: f/spaceid