16

We have some email templates in our email templates folder, but I'm not sure where they are being accessed or used. How do I investigate this?

I looked into the emailTemplate table, but it didn't provide any relevant information.

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_emailtemplate.htm

1
  • What if you uncheck Available for use and try and save it? Apr 18, 2013 at 20:20

5 Answers 5

20
  1. URL hack the "show dependencies" button available for example on Apex classes. https://instance.salesforce.com/packaging/dependencyPage.apexp?id=... - you can paste class id, page id, email template id... Good for initial reconnaissance. Probably you can achieve similar results while building a fake changeset and clicking show/add dependencies. It's not a 100% solution though.
  2. Try to delete it in sandbox and watch the fireworks ;)
  3. If delete has finished successfully - run all tests?

Seriously.

Static analysis (workflows email alerts listview, Eclipse search etc) will get you only so far. Templates can be referenced via Name, DeveloperName, Id and even if you'd cover all of these it's still not 100% foolproof as I've seen template Ids stored within custom settings or labels...

In the end - you know your codebase best :/

1
  • 1
    I tried deleting the template in sandbox and no fireworks happened =(. The sneaky developer placed the additional cc emails in custom settings /facepalm
    – compski
    Jun 25, 2020 at 7:01
4

If you only want to check Workflow Rules' Email Alerts, you can create a new view in

Setup --> Create --> Workflow & Approvals --> Email Alerts

with Email Template Name equals Value.

However, as aforementioned, the assumption is that Email Templates are only used in Workflow Rules' Email Alerts. Moreover, you have to create separate views for each Email Template you want to track.

2

You can use Salesforce Happy Soup, which provides 100% free Salesforce Impact Analysis. Happy Soup will tell you which email alerts are using your template, as well as which apex classes are using SOQL against the EmailTemplate object.

happysoup.io

PS: I'm the creator/owner of happysoup.io and I'm not trying to sell you anything. As stated above happy soup is FREE

0

I wish there was a better way to do this, however @Suman's answer did help as I was able to determine that the email template is used in APEX code and not Workflows.

0

You can try the Appexchange app Satrang Metadata Search, which will help you to do an Advanced Search on components like Flows, Process Builders, Apex Classes, Lightning Components, and Apex Triggers, etc. with your respective keyword, which can be the name of your email template, and you will get your desired results.

Here's the link: https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000009wgF7EAI

Disclaimer: I work at Satrang Technologies, the publisher of this Satrang Metadata Search AppExchange App.

You must log in to answer this question.

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