Skip to content

Commit

Permalink
fixed the email template when the description was marked as a link
Browse files Browse the repository at this point in the history
  • Loading branch information
2403905 committed Jun 27, 2024
1 parent 6ece248 commit 3520431
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions changelog/unreleased/fix-email-template.md
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions services/notifications/pkg/email/composer.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ func callToActionToHTML(s string) string {
if strings.TrimSpace(s) == "" {
return ""
}
s = strings.TrimSuffix(s, "{{ .ShareLink }}")
return `<a href="{{ .ShareLink }}">` + s + `</a>`
s = strings.TrimSuffix(s, "{ShareLink}")
return s + `<a href="{ShareLink}">{ShareLink}</a>`
}
4 changes: 2 additions & 2 deletions services/notifications/pkg/service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ https://owncloud.com
<br><br>
Dr. O&#39;reilly has shared "&lt;script&gt;alert(&#39;secrets of the board&#39;);&lt;/script&gt;" with you.
<br><br>
<a href="files/shares/with-me">Click here to view it: files/shares/with-me</a>
Click here to view it: <a href="files/shares/with-me">files/shares/with-me</a>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -384,7 +384,7 @@ https://owncloud.com
<br><br>
Dr. O&#39;reilly has invited you to join "&lt;script&gt;alert(&#39;secret space&#39;);&lt;/script&gt;".
<br><br>
<a href="f/spaceid">Click here to view it: f/spaceid</a>
Click here to view it: <a href="f/spaceid">f/spaceid</a>
</td>
</tr>
<tr>
Expand Down

0 comments on commit 3520431

Please sign in to comment.