Man this one has been bothering me. Why in the world can't you put HTML in the body (Intro) programatically?
(Author's Note: I had to put "[&]" where I mean "&" or else this forum will not render the message properly)
Just for fun I've built a button with an OnClick event that triggers and email from a Data Connection:
function CTRL596_5::OnClick(eventObj)
{
var emailrecip= XDocument.DOM.selectSingleNode("/my:myFields/my:emailrecip");
{
var objEmailAdapter = XDocument.DataAdapters("My Email Connection Name");
objEmailAdapter.To = emailrecip.text;
objEmailAdapter.CC = "";
objEmailAdapter.BCC = "";
objEmailAdapter.Intro = "Some special text"
objEmailAdapter.Subject = "Test Email";
objEmailAdapter.Submit();
}
}
As noted before, putting HTML tags in the .Intro object just renders the literal tag in the email. Why this is bothersome to me is if I configure the Data Connection with Intro text and put carriage returns in the box within the wizard dialog, those carriage returns are rendered properly in the email. So, I went digging into the .xsf file to see how the info was stored. Low and behold, my line with carriage returns looks like this:
<xsf:intro value="This line is two above[&]#xA;[&]#xA;this "></xsf:intro>
Hmmm. [&]#xA; forces a carriage return when this Intro is used. So, one would think you could do something similar in script, but alas, you may have guessed the following DOES NOT work (again, the literal values are put in the email intro).
objEmailAdapter.Intro = "Some special text[&]#xA;This is the next line"
Anyone see a way to get HTML (at least carriage returns!!!) in the Intro section of an Email Adapter object programmatically?