Loading

Deployment of Lightning Email Templates Using Metadata API and Visual Studio Code (VS Code)

Data pubblicazione: Aug 18, 2026
Descrizione

Lightning Email Templates cannot be deployed through a standard change set. Here we will see how to deploy a Lightning Email Template using the Metadata API and Visual Studio Code (VS Code).

Risoluzione

Step 1: Find the Email Template's Folder and Developer Name

First, run two queries to find out which folder the email template is in, and to get the developer name needed for retrieval.

Query to find the template's folder:

SELECT Id, Name, ParentId, DeveloperName FROM Folder

Query to find the developer name of the Lightning Email Template for retrieving purposes:

SELECT Id, Name, developerName, FolderName FROM EmailTemplate

## Step 2: Build the package.xml for Retrieval

Now use a package.xml file in the format below to retrieve the desired Lightning Email Template:

<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>unfiled$public</members>
<name>EmailTemplateFolder</name>
</types>
<types>
<members>unfiled$public/Merrill_Salesforce_Feedback_ET_1693339645628</members>
<name>EmailTemplate</name>
</types>
<version>54.0</version>
</Package>

Note: In the example above, "unfiled$public" is the public folder name, and "Merrill_Salesforce_Feedback_ET_1693339645628" is the Lightning Email Template's developer name under that folder.

## Step 3: Deploy the Payload

After retrieval, you get a zipped file containing the Lightning Email Template and its metadata.xml file.

Select the payload in VS Code and deploy it using a CLI command, or simply right-click the email template folder and deploy it directly.

VS Code file explorer showing the retrieved Lightning Email Template folder with the right-click deploy option selected 

Numero articolo Knowledge

000742641

 
Caricamento
Salesforce Help | Article