Did you ever get this sorted out? I'm having the same problem with html input being displayed as text instead of html in the email. Thanks!
Hi Paul
If I don't misunderstand your question, you want to decode the #HTMLTEXT# value. The easiest way you can do is to create your custom SendEmailAfterSubmissionActor by inheriting from SendEmailAfterSubmissionActor, override "RewriteUrls" method to decode content. This method seems the last one gets called before set to mail body property. (Don't forget to swap the SendEmailAfterSubmissionActor with your own one :))
Thanks for the suggestion!
After digging through the code I ended up adding a custom PlaceHolderProvider that sets performHtmlEncode to false if the current placeholder name contains the string "html". That way I can mix between encoded and non encoded placeholders.
Some code if anyone stumbles on the same issue in the future:
public new IEnumerable<PlaceHolder> ProcessPlaceHolders(IEnumerable<PlaceHolder> availablePlaceHolders, FormIdentity formIden, HttpRequestBase requestBase, Submission submissionData, bool performHtmlEncode)
{
IEnumerable<FriendlyNameInfo> friendlyNameInfos = this._formRepository.Service.GetFriendlyNameInfos(formIden);
foreach (PlaceHolder availablePlaceHolder in availablePlaceHolders)
{
PlaceHolder ph = availablePlaceHolder;
if (string.IsNullOrEmpty(ph.Value))
{
FriendlyNameInfo friendlyName = friendlyNameInfos.FirstOrDefault<FriendlyNameInfo>((Func<FriendlyNameInfo, bool>)(fn => fn.FriendlyName == ph.Key));
if (friendlyName != null){
performHtmlEncode = !friendlyName.FriendlyName.ToLower().Contains("html");
ph.Value = this._formDataRepository.Service.GetSubmissionDataFieldValue(requestBase, submissionData, friendlyName, performHtmlEncode);
}
}
}
return availablePlaceHolders;
}
Hi All,
I've extended Episerver forms to create an element that displays a summernote html wysiwyg area that allows the users to enter rich text.
This works fine, however when I attach a "Send email after form submission" and use a place holder say: "#HTMLTEXT#"
When the email is created the Html text gets encoded as plain text. ie
Any ideas on how this could be done?
Many thanks,
Paul