I have created a Salesforce Integration user in production with the Minimum Access - API Only Integrations profile and Salesforce API Integration PSL. I also created a custom permission set where I add the relevant permissions that should enable the user (using SFDX CLI) to run:
sf project deploy start -d ./force-app -o my-org -l RunLocalTests --dry-run --concise I have been running the above command and adding permissions to the custom permission set for any errors that are reported during the dry run.
There is one error that is related to classic email templates that I cannot seem to resolve:
Not available for deploy for this organization The classic email templates are located in /force-app/main/email/EMAIL_TEMPLATE_NAME. They all are Visualforce email templates.
I have tried the following:
- I have given the permissions as per this Salesforce help page for classic email templates.
- I have given the permission
Author Apex - I have given the permission
Customize ApplicationsandManage Public Classic Email Templatesas per this Salesforce help page which covers the creation of Visualforce email templates - I have ensured that these templates are in production
- I have ensured that the folders are accessible for all users
- Checked that these Visualforce templates cannot be added under
Visualforce Page Accesspermissions (they cannot)
I have also tried retrieving the metadata as per this answer with the command:
sfdx force:source:retrieve -m EmailTemplate:Custom_Template/Claim_Notification and got the error message:
Entity type 'EmailTemplate' is not available in this organization I have run out of ideas and I would really appreciate it if anyone can point me in the right direction where I can go look for the relevant permissions needed.
UPDATE:
I pulled some text emails into my repo with a Sys Admin user. I switched over to the Integration User and tried to deploy the text email templates. Same issue occurred as for the Visualforce email template, which confirms that it is a Email Template wide issue.
I came across this answer which mentioned a permission EmailTemplateManagement that could be the cause of not being able to access the email templates. I used Perm Comparator to compare a Sys Admin user with the Integration user:
The screenshot shows differing User Permissions between the two users. The Integration User does not have the EmailTemplateManagement permission.
How do you assign this permission in a permission set?
Thanks!



