I have been reviewing the documentation for Lightning Email Templates and it does not look like they can be deployed from one org to another. I have been unsuccessful retrieving them from the Metadata API. The documentation is not clear, but it does say they are not available in packaging. Trying to verify if that is case. Has anyone had any success with this as of yet?

  • 1
    there's an update about this, I have put a solution May 3, 2022 at 18:06

3 Answers 3


Opened a case with Salesforce they confirmed this is currently not possible. Lightning Email Templates can only be imported via a data import (eg. Data Loader).


Couple of things worth mentioning in addition to what @Olavo provided.

  • If you created your template in the Email Template Builder, there is also a FlexiPage associated with it. If you don't deploy the FlexiPage in your package, you will be unable to use Email Template Builder for future edits. The "Made in Email Template Builder" checkbox on the Email Template detail page will be unchecked in the target org, and you will not see the button to "Edit in Builder".

  • If you are just getting started with Lightning Email Templates, you may have created a Permission Set in your dev sandbox to allow yourself to create Lightning Email Templates. This permission set confers the System Permission "Access drag-and-drop content builder". If you don't have a corresponding Permission Set in your target environment, or if you haven't added yourself to that Permission Set, the deployment will fail. For this reason, you may have to follow a more complex deployment sequence:

    1. First deploy the Permission Set
    2. Manually assign users to the Permission Set
    3. Next, deploy your new Email Templates, Email Template Folders, and FlexiPages

You can do it...


  • Provide these SOQL in Developer Console...

SELECT Id, DeveloperName, CreatedDate FROM EmailTemplate ORDER BY CreatedDate DESC

  • If the EmailTemplate is called as "CaseAssignmentTemplate", its DeveloperName should look something like "CaseAssignmentTemplate_1651599832609"

  • Create the package as follows:

<Package xmlns="http://soap.sforce.com/2006/04/metadata">
  • Retrieve it to your machine
  • Deploy it to the target org
  • I was also able to do it via the CLI: sfdx force:source:retrieve -m EmailTemplate:SuccessSupportEmailTemplates/Support_Case_20_minutes_before_first_response_due_1672076816762 Dec 26, 2022 at 21:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .