How to determine where an email template is being used?

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

Answer

  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 :/

Attribution
Source : Link , Question Author : PartOfTheOhana , Answer Author : eyescream

Leave a Comment