How to set up email templates on Salesforce
Set up email templates in Salesforce by navigating to Setup > Email Templates, selecting a template type, and customizing the content with merge fields. You can create text, HTML, or Lightning templates for automated communications.
Prerequisites
- Active Salesforce org with admin or marketing user permissions
- Understanding of Salesforce Lightning Experience interface
- Basic knowledge of HTML for advanced template customization
- Access to email template creation permissions
Step-by-Step Instructions
Access Email Templates in Setup
Email Templates and select Email Templates from the results. This will take you to the email template management page.Create a New Email Template
- Text - Plain text emails
- HTML - Rich formatted emails
- Custom (without using Classic Letterhead) - Full HTML control
- Lightning - Modern responsive templates
Configure Template Properties
- Template Name - Internal name for identification
- Description - Brief explanation of template purpose
- Folder - Choose or create a folder for organization
- Available For Use - Check to make template active
Design the Email Subject Line
{!Contact.FirstName} or {!Account.Name}. Example: Welcome {!Contact.FirstName} - Your Account Setup is CompleteCreate the Email Body Content
- For HTML templates: Use the rich text editor or switch to HTML Source for custom code
- Add merge fields using Insert Field button
- Include dynamic content like
{!Contact.FirstName},{!Account.Name}, or{!Case.CaseNumber} - For Lightning templates: Use the drag-and-drop builder with pre-designed components
Add Attachments and Advanced Settings
- Attachments - Click Attach File to add documents or images
- Enhanced Letterhead - Select a letterhead if using HTML templates
- Encoding - Choose character encoding (usually UTF-8)
- Delivery Options - Set up tracking and delivery preferences
Preview and Test the Template
Save and Activate the Template
Common Issues & Troubleshooting
Merge fields are not displaying data correctly
Verify the merge field syntax is correct (e.g., {!Contact.FirstName}) and ensure the field exists on the target object. Check that the template type matches the record type you're sending from.
Users cannot see or access the email template
Check the folder permissions for the email template. Go to Setup > Email Templates, find your template folder, and verify that the appropriate user profiles have Read access to the folder.
Images are not displaying in email template
Upload images to Salesforce Documents or Files and use the generated public URL. Alternatively, host images externally and ensure URLs are accessible. Avoid using relative image paths.
Template formatting looks different when sent vs. preview
Email clients interpret HTML differently. Test your templates across multiple email clients (Outlook, Gmail, Apple Mail). Use inline CSS instead of external stylesheets and avoid complex CSS properties that may not be supported.