14

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

  • What if you uncheck Available for use and try and save it? – bigassforce Apr 18 '13 at 20:20
11
  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 :/

3

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.

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.

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.