Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Does not contain evaluation in an email template

lewisa12
New Contributor II
New Contributor II

Hello,

I'm looking to filter the recipients of an email template. What would be the syntax of the "does not contain" operation in the To: filed of an email template?

Example:

TO:

<% if (${user?.CUSTOMPROPERTY12} !='Y' && ${user?.CUSTOMPROPERTY20} == 'NewHire' && ${user?.LOCATIONDESC}*does not contain* 'Remote' and ${user?.title} *does not contain*'%FEMA%' && ${user?.employeetype} !='EX' and ${user?.statuskey} ='1') print "Adam@test.com" else print "" %>

3 REPLIES 3

rushikeshvartak
All-Star
All-Star

<% if (${user?.CUSTOMPROPERTY12} != 'Y' && ${user?.CUSTOMPROPERTY20} == 'NewHire' && !${user?.LOCATIONDESC}.contains('Remote') && !${user?.title}.contains('FEMA') && ${user?.employeetype} != 'EX' && ${user?.statuskey} == '1') print("Adam@test.com") else print("") %>


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

lewisa12
New Contributor II
New Contributor II

Thank you for the response. I'm getting the following error. Looks like it doenst like the P

2024-08-01T16:14:14-05:00-ecm-worker--null-x4c9f--2024-08-01T21:14:14.293444979Z stdout F 2024-08-01 21:14:14,293 [quartzScheduler_Worker-6] DEBUG changeaction.UserChangeActionService - NEW RULEACTIONFAILED = {"actionName":"Notify As An Email","ruleName":"Test Email Template","ruleKey":484,"actionFields":{"emailTemplate":"Facilities_POC"},"failureReason":"Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed:\nSimpleTemplateScript2978.groovy: 1: expecting ')', found 'print' @ line 1, column 57.\n ser?.CUSTOMPROPERTY12} != 'Y' print(\"Ada\n ^\n\n1 error\n"}

<%
if (user?.CUSTOMPROPERTY12 != 'Y' &&
user?.CUSTOMPROPERTY20 == 'NewHire' &&
!user?.LOCATIONDESC.contains('Remote') &&
!user?.title.contains('FEMA') &&
user?.employeetype != 'EX' &&
user?.statuskey == '1') {
print "Adam@test.com"
} else {
print""
}
%>


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.