You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deployment behaviour
We can deploy email templates to a target org without needing to deploy fields that are referenced in these email templates.
The linter feature in a nutsheel
The idea is to provide a linter feature that allow us to see what fields are not in the sfdx project but are in one of the email templates of the sfdx project.
Example of how fields are referenced in an email template
Dear {!Contact.FirstName},
Thank you for your interest in our product. We are pleased to provide you with the following information:
Account Name: {!Account.Name}
Custom Field Value: {!Custom_Object__c.MyCustomField__c}
If you have any questions or need further assistance, please feel free to contact us.
The text was updated successfully, but these errors were encountered:
What is the behaviour in case a email template contains a ref to a field that is not existing ?
Is the deployment failing ? Or does it passes then when the email template is used there is an error ?
@nvuillam based on the above example the email template would be deployed regardless of whether or not the field Custom_Object__c.MyCustomField__c exist (even if it's a cross object formula there is no check of each fields that are contained in the email template body during deploying).
No, I'll just leave the idea here since I noticed this behavior on a project.
I think the command hardis:lint:access can be reused specially the part where custom fields are retrieved and based on this we just need to iterate over all email templates and store all field references {!SObject.CustomField__c} and filter to keep only those who are not in the project.
Deployment behaviour
We can deploy email templates to a target org without needing to deploy fields that are referenced in these email templates.
The linter feature in a nutsheel
The idea is to provide a linter feature that allow us to see what fields are not in the sfdx project but are in one of the email templates of the sfdx project.
Example of how fields are referenced in an email template
The text was updated successfully, but these errors were encountered: