Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

How can can I determine where email templates are used?

How can can I determine where email templates are used?

Here is a SQL query which was recently provided in response to a YES! question.

1. E-mails attached to the "Notify when plan cancelled":

select
     da.Name as ServiceGroupName,
     ds.Name as ServiceName,
     dp.Subject as MonitorTaskName,
     de.LogicName as Event,
     demt.name as EmailTemplateName

from
     defevent de,
     defemailtemplate demt,
     defeventtrigger det,
     defproject dp,
     defservice ds,
     defarea da

where
     det.objectid = 21 and
     det.objectinstid = dp.projectid and
     de.eventid = det.eventid and
     demt.emailtemplateid = det.templateobjectinstid and
     ds.serviceid = dp.ownerinstid and
     da.areaid = ds.areaid

2. E-mails attached to all delivery plan tasks:

select
     da.Name as ServiceGroupName,
     ds.Name as ServiceName,
     dt.Name as TaskName,
     de.LogicName as Event,
     demt.name as EmailTemplateName

from
     defevent de,
     defemailtemplate demt,
     defeventtrigger det,
     deftask dt,
     defproject dp,
     defservice ds,
     defarea da

where
     det.objectid = 46 and
     det.objectinstid = dt.taskid and
     de.eventid = det.eventid and
     demt.emailtemplateid = det.templateobjectinstid and
     dp.projectid = dt.projectid and
     ds.serviceid = dp.ownerinstid and
     da.areaid = ds.areaid

3. E-mails attached to all approval tasks:

select
     da.Name as ServiceGroupName,
     ds.Name as ServiceName,
     dwsr.Subject as ApprovalReviewStep,
     de.LogicName as Event,
     demt.name as EmailTemplateName

from
     defevent de,
     defemailtemplate demt,
     defeventtrigger det,
     defworkflowsteproles dwsr,
     defservice ds,
     defarea da

where
     det.objectid = 57 and
     det.objectinstid = dwsr.steproleid and
     de.eventid = det.eventid and
     demt.emailtemplateid = det.templateobjectinstid and
     ds.serviceid = dwsr.ownerid and
     da.areaid = ds.areaid

Everyone's tags (1)
1 REPLY
New Member

How can can I determine where email templates are used?

Just add a line to the "where" clause to specifiy which service(s) you want to run this for rather than for the whole catalog:

--By Service Name

ds.Name = "My Service Name"

--By Service ID (Multiple services can be returned.)

ds.ServiceID IN ('1', '2', '3')

181
Views
0
Helpful
1
Replies
CreatePlease to create content