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
committed by GitHub
parent 85b3d006bf
commit 0d82258803

View File

@@ -607,7 +607,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.