Allow newlines in invite email and escape other html (#14618)

This commit is contained in:
Bjarke Berg
2023-08-02 12:39:06 +02:00
parent 04b74dddd0
commit f384e0c30c

View File

@@ -597,7 +597,7 @@ public class UsersController : BackOfficeNotificationsController
var emailBody = _localizedTextService.Localize("user", "inviteEmailCopyFormat",
// Ensure the culture of the found user is used for the email!
UmbracoUserExtensions.GetUserCulture(to?.Language, _localizedTextService, _globalSettings),
new[] { userDisplay?.Name, from, message, inviteUri.ToString(), senderEmail });
new[] { userDisplay?.Name, from, WebUtility.HtmlEncode(message)!.ReplaceLineEndings("<br/>"), inviteUri.ToString(), senderEmail });
// This needs to be in the correct mailto format including the name, else
// the name cannot be captured in the email sending notification.