Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Dynamic email template

Saviynt_learner
Regular Contributor II
Regular Contributor II

if we are sending emails using dynamic TO section. can we prevent email going to certain users(ex: cp1=yes) and redirect it to someone else like admin . and remaining case it should as per configuration.

11 REPLIES 11

rushikeshvartak
All-Star
All-Star
<%if(user.customproperty1=='YES'){print "Rushi@saviynt.com"} else {print ""}%>

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

<%if(user.customproperty1=='YES'){print "Rushi@saviynt.com"} else {print ""}%>

Here its checking  CP of which user. I couldn't understand the logic.

 

for example in usermanager campaign i need to send email notification to managers.  for few managers it should be redirected to Rushi@saviynt.com (xyz). How we can do it.

To get what variables are present to use in the email template, check using the below expression. By putting it in the email body, it will print all variable names with values, and then accordingly, you can use it:


${this.binding.variables.each {k,v -> println "$k = $v" + "" + "br" + ">"}}


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

dgandhi
All-Star
All-Star

Yes, below is the syntax of if-else condition in TO section

<% if (null!=user.email && user.email!='') print"${user.email}" else print"${user.secondaryEmail}" %>Email

dgandhi_0-1703737113706.png

https://docs.saviyntcloud.com/bundle/EIC-Admin-v23x/page/Content/Chapter06-EIC-Configurations/Creati...

 

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

CR
Regular Contributor III
Regular Contributor III

Try below:

<% if (null!=user.customproperty1 && user.customproperty1=='YES') print"Rushi@saviynt.com" else print"${manager.email}" %>

Thanks,
Raghu
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Saviynt_learner
Regular Contributor II
Regular Contributor II

can we check for the user's manager's customproperty here?:  user.customproperty1=='YES'

user.manager.customproperty1=='YES'


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

CR
Regular Contributor III
Regular Contributor III

@Saviynt_learner 

try :

manager.customproperty1=='YES' or user.manager.customproperty1=='YES'


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Manu269
All-Star
All-Star

@Saviynt_learner you need to have a mapping of user with CP values to be used as part of email template.

<%if(user.customproperty1=='YES'){print "Manu@test.com"} else {print ""}%>
Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

Saviynt_learner
Regular Contributor II
Regular Contributor II

This doesn't seem to be working. Is there any other way to achieve it besides using an email template

It should work share all steps you have tried


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.