Hi,
I have a biz form and when that form is submitted it triggers a CMSModule. The module finds out 5 different alias paths and gets information from HTML fields which are part of a custom page type.
This is the following code
if (!string.IsNullOrEmpty(answer6NodeAliasPath))
{
node6 = tp.SelectSingleNode(CMS.SiteProvider.SiteContext.CurrentSiteName, answer6NodeAliasPath, "");
node6Value = node6.GetStringValue("AnswerExplanation", "");
}
string[,] macros = new string[,] {
{ "text1", WebUtility.HtmlEncode(node1Value) },
{ "text2", WebUtility.HtmlEncode(node2Value) },
{ "text3", WebUtility.HtmlEncode(node3Value) },
{ "text4", WebUtility.HtmlEncode(node4Value) },
{ "text5", WebUtility.HtmlEncode(node5Value) },
{ "text6", WebUtility.HtmlEncode(node6Value) }
};
MacroResolver macroResolver = new MacroResolver();
macroResolver.SetNamedSourceData(macros);
if (emailTemplate != null)
{
EmailMessage emailMessage = new EmailMessage();
emailMessage.EmailFormat = EmailFormatEnum.Html;
emailMessage.Recipients = emailFieldValue;
emailMessage.From = emailTemplate.TemplateFrom;
emailMessage.Subject = emailTemplate.TemplateSubject;
EmailSender.SendEmailWithTemplateText(CMS.SiteProvider.SiteContext.CurrentSiteName, emailMessage, emailTemplate, macroResolver, true);
}
I am using an HTML email template which is very basic right now
<p>{%text1%}</p>
<p>{%text2%}</p>
<p>{%text3%}</p>
<p>{%text4%}</p>
<p>{%text5%}</p>
<p>{%text6%}</p>
The value of text1 is HTML data with HTML tags. The tags are not getting rendered in the email. The email shows up as
My organization has a strong service vision and values<br /> 1. You scored yourself: Agree<br />
Any ideas?
Thank you