Cli: It is not possible to pull or push lightning email template folders

Created on 3 Dec 2019  路  7Comments  路  Source: forcedotcom/cli

Summary

It is not possible to pull or push lightning email template folders.

Steps To Reproduce:

  1. Create a new scratch org.
  2. Create a lightning email template folder named LETF.
  3. Create a lightning email template named LET.
  4. sfdx force:source:pull

Expected result

Three files should be created

  1. LETF/LET.email
  2. LETF/LET-meta.xml
  3. LETF.emailFolder.xml

Actual result

The first two files are created, but no file for the email template folder is created.
When I try to push the source to a new scratch org I get the error:
Cannot find folder:LETF

Additional information

Even if I create the file
LETF.emailFolder.xml
with the content
<?xml version="1.0" encoding="UTF-8"?> <EmailFolder xmlns="http://soap.sforce.com/2006/04/metadata"> <accessType>PublicInternal</accessType> <name>LETF</name> <publicFolderAccess>ReadWrite</publicFolderAccess> </EmailFolder>

I get the error message:
To create an email template, specify a folder with the type EmailTemplate.

But I have no idea how that could be done.

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.33.2-045d48473e darwin-x64 node-v10.15.3

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.1 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.8 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.5 (core)
analytics 1.2.1 (core)
generator 1.1.1 (core)
salesforcedx 47.6.2 (core)
鈹溾攢 salesforcedx-templates 47.6.2 (core)
鈹斺攢 salesforce-alm 47.9.0 (core)

sfdx-cli 7.33.2 (core)
OS and version:
Mac OS 10.14.6

more information required

Most helpful comment

@shocks13 - I had the same issue, was able to resolve it by manually creating the emailFolder metadata record. So under the email folder in SFDX project, I created a new XML file with details about my email folder. For example:

Folder Name is Samples.
Create Samples.emailFolder-meta.xml with the following xml
<?xml version="1.0" encoding="UTF-8"?> <EmailFolder xmlns="http://soap.sforce.com/2006/04/metadata"> <accessType>PublicInternal</accessType> <name>Samples</name> <publicFolderAccess>ReadWrite</publicFolderAccess> </EmailFolder>

All 7 comments

@vincebhh we are unable to reproduce this issue. I am not super familiar with lightning email templates and folders. Would you please give us a little more detail around how you created these in the Scratch org? Did you enable this is the scratch org:
image
or did you have that already set in your scratch definition file?

This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.

@clairebianchi I have the same issue now with sfdx-cli/7.54.4-8ff9ba9cc5
It looks like it's not possible to enable "Folders and Enhanced Sharing" through the scratch org definition file that causes that issue.

I believe what @vincebhh is talking about is Classic Email Template folders. I have successfully pulled some email templates that are in a folder, however when I try to push them to a scratch org, it errors out saying "Cannot find folder:"

It appears that SFDX doesn't allow for pushing new Classic Email Template folders. Any thoughts @clairebianchi?

@shocks13 there is no issue with Classic Email Templates. All Email template folders and templates can be retrieved and deployed using sfdx cli. But when I create a Folder for Lightning Email Templates this folder is not retrieved by the cli. And if I create meta file manually they still can't be deployed.

@shocks13 - I had the same issue, was able to resolve it by manually creating the emailFolder metadata record. So under the email folder in SFDX project, I created a new XML file with details about my email folder. For example:

Folder Name is Samples.
Create Samples.emailFolder-meta.xml with the following xml
<?xml version="1.0" encoding="UTF-8"?> <EmailFolder xmlns="http://soap.sforce.com/2006/04/metadata"> <accessType>PublicInternal</accessType> <name>Samples</name> <publicFolderAccess>ReadWrite</publicFolderAccess> </EmailFolder>

@shocks13 - I had the same issue, was able to resolve it by manually creating the emailFolder metadata record. So under the email folder in SFDX project, I created a new XML file with details about my email folder. For example:

Folder Name is Samples.
Create Samples.emailFolder-meta.xml with the following xml
<?xml version="1.0" encoding="UTF-8"?> <EmailFolder xmlns="http://soap.sforce.com/2006/04/metadata"> <accessType>PublicInternal</accessType> <name>Samples</name> <publicFolderAccess>ReadWrite</publicFolderAccess> </EmailFolder>

Thank you @Jkenney94 - this worked for me

Was this page helpful?
0 / 5 - 0 ratings