> >
||||||||||||

How To For Professional Email Templates in Salesforce

Veuillez noter que ce billet est présentement disponible uniquement en anglais
Email templates provide a variety of benefits. Upfront work to create professional looking templates will save time in the long run. Also, because multiple users can have access to templates branding guidelines can be better adhered to and messaging consistent across business units.

What email template should you choose?

Salesforce provides 4 email template types. Here’s an overview of the different types and some considerations.

1. Text Email Templates

This template only contains text, no formatting is possible (e.g. font color, font size, bold…)

You can use this type of email template when manually sending an email (manually clicking “Send an Email” from the Activity History related list). With this option, you can change the formatting and also modify the content.

2. HTML (Using Letterhead) Email Templates

You will need to create a Letterhead, which is the visual container of the email. You also need to select an email Layout. This specifies how the content is distributed. The email formatting can be done using the Formatting Controls, no HTML/CSS knowledge needed. This can result in a professional looking email.

You can use this email template when manually sending an email. With this option, you can change the formatting and also modify the content.

 

3. Custom (without using Letterhead)

No letterhead needed, but you will need to build your own HTML and CSS  to customize the email layout and formatting.

You will be able to re-use the email template when manually sending an email, but you won’t be able to modify the layout or the content of the email.

 

4. Visualforce

You need HTML, CSS and Apex knowledge if you want to use this template. Visualforce templates allow you to have access to information from other records instead of just being limited to the information on the current record. You can also specify a “Reply-to” address. You can re-use this email template when manually sending an email, but you won’t be able to modify the layout or the content of the email.

Tips and tricks

Custom date formatting

Salesforce uses the system’s location settings to format the date. However, most organizations like to display dates on different formats. You can use formulas to customize the date format.

e.g. If you need to format the date like this Month DD, YYYY. Here’s the formula you need, where Record.DateField is your date field.

{!CASE(MONTH(Record.DateField),1,”January”,2,”February”,3,”March”,4,”April”,5,”May”,6,”June”,7,”July”,8,”August”,9,”September”,10,”October”,11,”November”,12,”December”,”Month”)} {!DAY(Record.DateField)}, {!YEAR(Record.DateField)}

Display information from other records

You have 3 options to achieve this.

  • Use a Visualforce template. As mentioned previously, you need to create your own CSS, HTML.
  • Send your email by trigger. From a trigger, you can choose an email template and update the content to add information from other records before you send the email.
  • Add a Text Area field on the record and populate it’s content with the information from the other records. e.g. A trigger on Opportunity Lines updates a Text Area field on the parent Opportunity to include the Product name, quantity and amount. Then simply add that Text Area field on the email template.

Add record link

There is a Merge Field value you can use to add the current record link: {!Account.Link}. However the recipient will see something like this: https://na17.salesforce.com/001o00000031ABP.

If you want to customize the text the recipient sees, you will need an HYPERLINK() function inside a formula field: HYPERLINK(‘/’ & Id, ‘Click here to view record’)

If you are using an HTML template, you can also enter the text you want to display on the email template, click on the “Insert a Link” icon and set the link Merge Field value on the pop up window.

The end result will be: Click here to view the record.

 

Attach email sent to record

Emails sent by workflow don’t appear on the Activity History related list, like the emails sent manually do. A workaround is to use the Email To Salesforce functionality.

Email to Salesforce lets you attach emails to Salesforce Objects by sending the email to a email address auto generated by Salesforce.

If you add that generated address on the “Additional Address” field of the email alert, the email will be attached to the contact / lead that the email was sent to.

Additional, if you want to attach the email to a record other that a contact or a lead, you must add this to the email body or subject: ref: RECORD_ID. e.g. You want to attach the email to a custom object with id a0v170000004CFu, you will need to add ref: a0v170000004CFu on your email body.

 

Pablo Herrera
Pablo Herrera is one of Big Bang ERP's resident Tech Leads. Since joining Big Bang ERP Pablo has become a valuable team member through his expert knowledge of NetSuite, Salesforce and FinancialForce. He participates in cloud business solutions architecture definition, configuration and customization, as well as the deployment of various subsystems such as e-commerce & online marketing platforms, accounting & payroll software, manufacturing, supply chain and warehouse management solutions.