How to deploy email templates with Gearset
This article explains how to deploy email templates and email template folders between Salesforce orgs using Gearset. This applies to both Lightning Email Templates and Classic Email Templates.
Overview
Email templates and their folders are both retrieved under the Email template metadata type in Gearset. You need to include both the template and its folder when deploying to make sure the deployment succeeds in the target org.
Important: Only templates and folders stored in a public or shared location can be retrieved via the Metadata API. Templates saved in a private space won't appear in Gearset's comparison.
Before you start
Make sure the following are in place before deploying:
Your email template is saved in a public or shared folder in Salesforce, not in a private folder.
You have connected both your source and target orgs to Gearset.
How to deploy email templates
In Gearset, go to Compare and deploy and select your source and target.
Click Compare now to start the metadata comparison.
In the metadata type filter on the left, select Email template to filter the comparison results.
In the comparison results, you'll see your email template and its folder listed as separate items, both under the Email template metadata type.
Select both the email template and its email template folder. You need both for a successful deployment if the folder is not present on the target.
Click Next and proceed through the deployment steps to deploy to your target org.
What to expect in the comparison
The screenshot below shows an example comparison. The email template and its folder both appear under the Email template metadata type. In this example, both items are new in the target org.
Things to keep in mind
Both Lightning Email Templates and Classic Email Templates use the same Email template metadata type in Gearset.
If you don't select the folder alongside the template, the deployment may fail in the target org if the folder is not present.
If a template isn't appearing in the comparison, check that it's stored in a public or shared folder in the source org.

