Skip to content

Commit

Permalink
Allow newlines in invite email and escape other html (#14618)
Browse files Browse the repository at this point in the history
  • Loading branch information
bergmania authored Aug 2, 2023
1 parent 85b3d00 commit 0d82258
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ private async Task SendUserInviteEmailAsync(UserBasic? userDisplay, string? from
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.
Expand Down

0 comments on commit 0d82258

Please sign in to comment.