function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vaclav LukasekVaclav Lukasek 

Email template editation in release winter 2016

I sent notes about Email Template editor create improper data due inserting bad values to merged fields like:
{!Case.Id} became <span>{!</span>Case.Id<span>}</span>
this situation was not fixed but i load EmailTemplate.HtmlValue from different source, but now it crash on
HTML Value: The HTML Email Content contains improperly formatted merge fields. Please check the format of all the merge fields to ensure they start with {! and end with }.

inserted html was pasted from word and reduced html value cause this failure is

<table border="0" cellpadding="5" cellspacing="5" style="height:400px; width:550px">
    <tbody>
        <tr>
            <td style="background-color:#FFFFFF"><!--[if gte mso 9]><xml>
 <w:WordDocument>
 </w:WordDocument>
</xml><![endif]--><!--[endif]----><!--[if gte mso 10]>

<![endif]--></td>
        </tr>
    </tbody>
</table>

Vaclav LukasekVaclav Lukasek
mininimal example:
FAIL:
<div><!--[endif]----></div>
PASS:
<div><!--[endif]--></div>
Vaclav LukasekVaclav Lukasek
Affect Template Style: Free Form Letter
Also fails with same error if html contains hmtl entities like &nbsp; or &ndash;
seshu paturuseshu paturu
Use EmailTemplate.Body instead of EmailTemplate.HTMLValue.
It works fine.
Vaclav LukasekVaclav Lukasek
I guess you dont know difference between HtmlValue and text value if you generate multiple content (not only text version)
otherwise you will now that Body contains text version of message and HTML contains tagged version of message for Outlook or webBrowser