[SalesForce] How to retreive an email template stored in Public Email Templates using metadata

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.

Best Answer

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.