Call Toll Free (877) 928-3337



  • Home
  • Blog
  • Tips & Tricks for Salesforce Email Templates

Tips & Tricks for Salesforce Email Templates

A great feature of is Email Templates. This article consolidates various knowledge articles and addresses some of the configuration nuainces of this functionality as well as provides some tips and tricks.

Types of Email Templates and when to use them.  Salesforce provides 4 types of email templates: Text, HTML with Letterhead, Custom HTML and Visualforce.

Who can Create HTML templates?  In order for your users (non-administrators) to create HTML templates, they must have the "Edit HTML Templates" permission in their profile.  For Professional Edition customers, this can be achieved by setting their profile to "Marketing User" instead of "Standard User".  Be aware, by making them a "Marketing User", they can manage campaigns, import leads, create letterheads, create HTML email templates, manage public documents, and update campaign history via the import wizards. The Marketing User profile also has access to the same additional functionality as the Standard User.

Adding a Dynamic Personal Signature or Headshot to your email template - if you would like your users to use a custom signature block that contains an image of their signature or a headshot or some other graphic that varies from user to user, follow these steps:

  1. Save the image for each users as an image file (GIF, JPG or PNG) and ideally store it on your companies server in a known location (e.g., For each image, give a name to it based on some unique value on the user record (e.g., First+Last+.GIF)
  2. Have your administrator create a custom formula field on the User record that is of type=TEXT and user the Image function to reference this image (dynamically plug in the file name.  for example,   IMAGE(""&trim(lower(FirstName))&trim(lower(LastName))&".jpg", FirstName &" "& LastName )
  3. You can now insert this field into the HTML template by selecting the field from the Sending User field list.

Setting Template Margins - does NOT provide any controls for either the margins of your template, width of the standard body, or the fact that the HTML Template will be centered on the page. If you are experiencing extra-wide or narrow formatting, see the next item, which is likely to be the cause.

Cutting and Pasting from External Tools (e.g., MS Word or Web Pages) - Sometimes when using HTML Email Templates you may end up with strange formatting results or what looks like stray programming code.  This is normally caused because you have cut and pasted the text into the salesforce HTML template from a document such as MS Word that contains hidden formatting. To prevent this, we recommend typing your HTML Emails into salesforce directly (not cutting and pasting) OR use a text-only editor like Notepad on the PC or TextEdit on the Mac (in plain text mode).  Cut and Paste from your formatted document to one of these programs then re-copy and paste into salesforce. This will prevent any unwanted code from being inserted. Once such code is in the template, you can't see it and it is difficult to remove.  You can also resolve this issue by changing your template encoding to UTF-8. Another side-effect of cutting and pasting from an external program into a salesforce email template is some characters may turn into question marks.  If is converting apostrophes or quotation marks into question marks, these characters were formatted by your word processor program and are non-standard characters that are not recognized by As a result, these characters will be changed to question marks. To prevent this from happening it is best to either turn off the AutoFormat function in Microsoft Word, or undo the auto-formatting as it occurs. One method of removing the auto-formatting is to copy and paste the text into a blank notepad, and then cut and paste the text into your e-mail. Alternatively, you can also edit your template in and manually type over any affected characters and re-save. Another way of fixing this issue is to change your template encoding to UTF-8.

Colors/Fonts - If you need additional color choices other than the colors provided in the HTML Editor palette, you will need to use the Custom HTML template.

Text-Only Version of HTML and Custom Emails - recommends that you leave the text-only version blank. When you leave the text-only version blank, Salesforce automatically creates the text-only content based on the current HTML version. If you choose not to leave the text-only version blank and instead manually create a text-only version, edits to the HTML version are not reflected in the text-only version.

Letterhead Images - The width of the header in an HTML email template is 550 pixels wide when using the Free Form Letter layout. Images should be pre-sized to this width as they cannot be re-sized inside of

Creating Special Fonts in Signatures and Letterheads - This is one way to hard code your Fancy Fonts in Signatures, Letterheads and Footers, as oppose to writing HTML.

In regards to setting up a signature with particular fonts in HTML. 

Font choices have and are always limited in compatibility and availability from sender to recipient. 

What the creator of the email template (sender) might choose, might not necessarily be available for the recipient of the email (either not stored on their local machine or server). This will result in font defaulting to something similar but not necessarily a like and throw out all your desired look and feel. 

Another way around this is to host these fonts of choice on a server and refer to them through Style sheets, but this too is an issue as the User needs experience and expertise in writing HTML and style code. 

The easiest and perhaps the most common way to make sure of a font is keeping its desired look and feel is to include it as an image in a Letterhead (as a Header, Footer, Signature). 

Design a letterhead with only a 'header footer or signature' and attach this to the email that you create. 

Using a stored image or editing program/application create an Image of the Letterhead or Footer save it in your personal or public Documents folder (Documents Tab in Salelesforce CRM / Your Org). 
NOTE: Try to keep the image width to 600 pixels maximum, height is variable. Jpeg or Gif Image only. Optimize to 100dpi or less (web default is 72dpi).



Formatting the TODAY Date - If you have ever inserted the current date in an email template you know it formats at MM/DD/YYYY (e.g., 05/10/2011).  If you want it to display as May 10, 2011 or some other formatting, the trick is to have your administrator create a custom formula field on the USER record that reformats this date and then you can use this field (Send User Field) in your template. This is the same concept as noted above for adding a dynamic personal signature.

This can be achieved by setting up on the User object a custom formula field that will return (as a text) the desired date format.

Once this field has been set up, you can use it as a merge field in your email templates, instead of the standard {!Today} merge field.

The formula to be used in the custom formula field is the following:

TEXT(DAY(TODAY()))&" "&CASE(MONTH(TODAY()),1,"January",2,"February",3,"March",4,"April",5,"May",6,"June",7,"July",8,"August",9,"September",10,"October",11,"November","December")&" "&TEXT(YEAR(TODAY()))

Keep templates organized - Keep your templates up to date and easily accessible. Make sure to keep public and personal templates separate.

  • Ask users to place all self-created templates in a personal folder. Use the Clone button to copy public templates into a personal folder.
  • Deactivate old templates by unchecking the Available for Use checkbox. Note that deleted email templates are not stored in the recycle bin, but are permanently deleted. If you think you may need these templates again, deactivate rather than delete them.

Images in Custom HTML Templates - If you are including an image, we recommend uploading it to the Documents tab so that you can reference the copy of the image that is on our server. For example:

<img src=" id=015D0000000Dpwc&oid=00DD0000000FHaG&lastMod=1270576568000" alt="Company Logo"  height="64" width="64"/>

Have other tips for email templates?  Let us know!