Email Template
An Email Template is a reusable blueprint for the content of an outgoing email in Salesforce: subject, body, merge fields, attachments, and HTML styling.
Definition
An Email Template is a reusable blueprint for the content of an outgoing email in Salesforce: subject, body, merge fields, attachments, and HTML styling. Templates are stored as records and referenced by Email Alerts, Process Builder and Flow Send Email actions, Approval Process notifications, manual record sends, and (in Marketing Cloud Engagement contexts) marketing campaigns. The same template can serve a hundred different sends; updating it once propagates the change everywhere it is used.
Salesforce supports three template types for the platform email (separate from Marketing Cloud's Content Builder). Classic Email Templates date to pre-Lightning Salesforce and remain widely used. Lightning Email Templates were introduced in 2018 with a modern editor, rich formatting, and easy merge-field insertion. Visualforce Email Templates are programmatically generated via Apex and Visualforce markup, supporting complex content beyond what the visual editors can produce. Choosing the right type is mostly a function of complexity and existing template inventory.
How Email Templates work across Salesforce
The three template types: Classic, Lightning, Visualforce
Classic Email Templates: the original. Text, HTML, or Visualforce, with merge fields and attachments. Lightning Email Templates: 2018 successor, built on the Lightning Experience editor. Visualforce Email Templates: code-defined with Apex variables, used for templates that need conditional logic, complex layouts, or repeating loops. All three coexist; new templates default to Lightning.
Merge fields and dynamic content
Templates use merge field syntax to pull data from the record context: {!Account.Name}, {!Contact.FirstName}, {!Case.Subject}. When the template is rendered, Salesforce resolves the merge fields against the triggering record. Custom fields work the same way: {!Opportunity.Amount__c}. The available fields depend on the template''s associated object.
Folder organization and sharing
Templates live in Email Template folders. Folder sharing controls who can use and edit templates: Public Read, Public Read/Write, or specific user/role/group access. Most orgs structure folders by team (Sales, Service, Marketing) or by purpose (Welcome, Renewal, Escalation). Folder hygiene becomes critical as the template count grows past 100.
Template attachments and dynamic file inclusion
Templates can include attachments: static files (a marketing PDF), dynamically generated files (a Visualforce-generated PDF), or files attached to the record (a Case''s documents). Static attachments live with the template; dynamic attachments are produced at send time. Either way, the total email size including attachments must stay under the 25 MB platform limit.
Versioning and approval workflows
Salesforce does not version Email Templates natively (no history of changes). For regulated industries, organizations build Approval Processes on the Email Template object to require sign-off before changes deploy. Source-controlled deployment (via Salesforce DX) gives versioning at the deployment level: the template''s XML is in Git, with the usual commit history.
Marketing Cloud templates versus Salesforce platform templates
Marketing Cloud Engagement has its own template system inside Content Builder, separate from Salesforce platform Email Templates. Sales Cloud agents replying to a customer use Salesforce platform templates. Marketing teams sending newsletters use Marketing Cloud templates. The two systems do not share templates; they exist on different platforms with different content models.
Email-to-Case auto-response and template selection
Email-to-Case can auto-respond to inbound emails with a template-based acknowledgement. Setup, then Email-to-Case, then Auto-Response Rules, then assign a template. The customer gets an immediate We-received-your-message reply while the Case routes to an agent. This is the foundation of professional service-desk responsiveness.
How to create a Lightning Email Template
Lightning Email Templates are the modern default for new platform email content. The editor is similar to a basic word processor; merge fields and quick links make them powerful enough for most use cases.
- Open Email Templates in Setup
Setup, then Email Templates. Click New Email Template. The Lightning editor opens.
- Name the template and pick a folder
Provide a descriptive name (Case_Acknowledgement_Standard, Opportunity_StageChange_ClosedWon). Pick a folder for sharing; if a folder for this team does not exist, create one.
- Compose the subject and body
The Subject field appears in the recipient''s inbox. The Body uses the rich-text editor: format headings, add bullets, embed images. Use the Merge Field picker to insert dynamic fields from the related object.
- Set the related object
On the template, specify the related object (Case, Lead, Opportunity, Account, Contact). The merge fields available are constrained to that object''s fields and its related objects.
- Test the template
Use the Preview button with a sample record to see the rendered email. Confirm merge fields resolve and formatting renders cleanly.
- Save and use
Save the template. It now appears in pick-lists for Email Alerts, Send Email actions, and manual record sends. Reference it by name.
Clear descriptive name for the template. Appears in pick-lists across the platform.
The sharing boundary. Controls who can use and edit the template.
Email subject line. Can include merge fields.
Email content with text, HTML, and merge fields.
- Lightning Email Templates and Classic Email Templates are separate objects. Some Setup pages list them together; others do not. Search both if you cannot find a template.
- Merge fields must reference fields the user can read. A merge field for a field hidden by field-level security renders blank, which is usually surprising.
- Templates are not version-controlled by default. Changes overwrite the prior content with no history. Plan a backup or use Salesforce DX for source control.
- Email Template names must be unique within a folder. Across folders, duplicate names are allowed but cause confusion when picking the right template later.
Trust & references
Straight from the source - Salesforce's reference material on Email Template.
- Email Template Types and CapabilitiesSalesforce Help
- Lightning Email TemplatesSalesforce Help
About the Author
Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.
Test your knowledge
Q1. What is an Email Template?
Q2. What's the modern email template format?
Q3. What do merge fields do in templates?
Discussion
Loading discussion…