I'm trying to identify where a bunch of Email Templates are being used. I didn't find them under WF Rules/Email Alerts using the Template Name and I think some of them may be referenced through Apex Code. Is there a way to determine where each template is being referenced in Salesforce in relation to a Custom Object? Thanks


The easiest way to do this is to use SFDX/VSCode (or some other similar tool that interfaces with the Metadata API). Once you have everything set up, you'll be able to pull down your org's Metadata. Then it should be as simple as CTRL/CMD-F to see if the template name is referenced in any files.

  • +1 I would also recommend searching by ID, because some developers decide to do that, despite being a bad idea. – sfdcfox May 12 at 16:20
  • Unfortunately I don't have access to SFDX/VSCode currently. So I used the Developer console and ran a SOQL query on EmailTemplate to determine the IDs, ran a search with the ID in SF but it generated no results. So maybe I missed something here. Or any other methods I could possibly explore? – BodegaBlanco May 12 at 16:36
  • 1
    If you have access to Workbench, you can download metadata that way as well. In the "Migration" menu, you'll see the option to retrieve. You'll need to create a package file with all the Metadata that you think might contain an email template and you can use that to retrieve the Metadata. – Nicholas Savini May 12 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.