0

I created a email template directly in the email tab of contact and saved it as a template in Public Email Templates folder. How can I retreive this email template stored in My templates -> Public Email Templates using metadata? I have tried using sfdx force:source:retrieve -m EmailTemplate:Public\Email\Templates\/My_Email_Template. Also tried from package.xml. I get No results found.

2 Answers 2

1

Just came across the same issue, this worked for me:

sfdx force:source:retrieve -m EmailTemplate:unfiled\$public\/My_template_API_name
0

Add below syntax in your package.xml:

<types>
<members>unfiled$public</members>
<members>unfiled$public/Your_Template_Unique_Name</members>
<name>EmailTemplate</name>
</types>

The Unfiled Public Email Templates folder name in Salesforce is unfiled$public.

Let me know if it helps.

5
  • tried it. says no results found.
    – nSv23
    Aug 6, 2020 at 16:15
  • @nSv23 What is the template type? please confirm if "Available For Use" is checked or not. Manage Public Classic Email Templates/Manage Public LightningEmail Templates permission is checked at profile level.
    – SFDCDJ
    Aug 6, 2020 at 16:22
  • I didnt create it from setup. I created from contacts page. You have a tab for email in contacts page. You click it, and you have save as template option. I was only able to save it Public Email Templates folder (a default saleforce folder)
    – nSv23
    Aug 6, 2020 at 16:29
  • If understand correctly you created lightning template. Seems that currently you cannot import and deploy it as other metadata. You can however, import and export it with data loader as data -trailblazer.salesforce.com/ideaView?id=0873A000000EDG9QAO
    – Liron C
    Aug 6, 2020 at 16:55
  • @LironC what i did was I created a scratch org and replicated the template and in VS code when I did pull changes from scratch org., I was able to download it, but its downloaded into the folder: email/unified$public with name of my template with underscores for spaces followed by some numbers like this my_template_148587510.
    – nSv23
    Aug 6, 2020 at 20:54

You must log in to answer this question.

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