1

I need to update an email template which is initially created as a Custom (without using Letterhead) email template to a HTML (using Letterhead) email template. The reason for this modification is , I need to make editable the email template once user going to send an email. Is that possible to do this?

  • I want to do exactly the same. I have tried to copy a sent Custom email, first to Word, then from Word to an empty HTML email template. Both copy actions: Ctrl-A, Ctrl-C, Ctrl-V. It looks decent in the HTML email template editor and it even gives the impression that images, that are links, work (so: <img> inside <a> </a>). But it you actually use the HTML template, the links around <img> tags are stripped away (other links stay in place). In the Custom email template this worked perfectly. But we also found out that our users need to edit the emails after template application. – Sander de Jong Aug 29 at 11:19
2

One option we can think that you create the email template as a HTML template and refer the letterhead values from a custom settings where the user will have access . whenever he want to specify the value he can change those custom settings value to get the desired values.

  • Please elaborate on this answer, to me it sounds as if it doesn't answer the question at all. – Sander de Jong Aug 29 at 11:23
1
+250

I think you might be able to get away with it by updating the metadata directly (*.email and *.email-meta.xml files) using your favourite IDE, say Eclipse. I haven't tested it but it seems that just by looking at the appropriate values for HTML and custom for the meta.xml files and then 'converting' the email component, it could work. I suggest getting an example for each type, compare the formats and then 'convert'. Hope this helps.

1

At the same time that Francis A. made his suggestion, I was working on the same solution (great minds... ;-). And I have actually tested it, I now know how to do this.

It is possible to get the sources of email templates in Eclipse. I had to manipulate the package.xml file to get this done, but normally this should work out of the box.

The source of an HTML mail looks like this:

<table border="0" cellpadding="5" width="800" cellspacing="5" height="400" >
<tr valign="top" height="400" >
<td tEditID="c1r1" style=" background-color:#FFFFFF; color:#000000; bEditID:r3st1; bLabel:main; font-size:12pt; font-family:arial;" aEditID="c1r1" locked="0" >
<![CDATA[<p style=...</p>]]></td>
</tr>
</table>

By substituting the <p style=...</p> with the HTML code of the custom email template, you have done most of the work. Except that you need to convert <style> tags into inline CSS.

The resulting email almost looks like the custom email, except for the left and right margins. I googled for this a lot, but no-one seems to know how to get rid of those margins. They are especially annoying when you use the MS Outlook client: then the email appears to be too narrow, but if you print it, it turns out to be too wide. Thank you Microsoft.

Anyway, I now have an email template that looks for 95% the way I want it to, and it is editable by the users after selection. For me it is good enough!

0

There's no way to change template's type once created.

Because Custom (without using Letterhead) templates and HTML (using Letterhead) templates are different in SF implementation(metadata structure) even these two templates are storing in separate objects in salesforce (EmailTemplate and BrandTemplate ).

So you can't change Custom (without using Letterhead) email template to an HTML (using Letterhead) email template. You will need to create the new HTML (using Letterhead) template and reframe/move your HTML elements to the new template.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.