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

Conditional email generation

RV
Regular Contributor
Regular Contributor

We are using Identity Lifecycle -> Email generation and looking to add conditions to generate an email only for certain users.  Is it possible to add conditions in email generation so it only generates for few conditions and then do nothing on other conditions?  What is the syntax for if/elseif in email generation logic?

if (user.customproperty1='Employee') {

email generation logic for employees 

} else if (user.customproperty1='Contractor') {

email generation logic for contractors

} else {

do nothing

}

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

if(users.employeetype='Contractor',concat(left(lower(users.firstname),1),".",lower(users.lastname),".con@rushi.com"),concat(left(lower(users.firstname),1),".",lower(users.lastname),"@rushi.com"))#if(users.employeetype='Contractor',concat(left(lower(users.firstname),2),".",lower(users.lastname),".con@rushi.com"),concat(left(lower(users.firstname),2),".",lower(users.lastname),"@rushi.com"))#if(users.employeetype='Contractor',concat(left(lower(users.firstname),3),".",lower(users.lastname),".con@rushi.com"),concat(left(lower(users.firstname),3),".",lower(users.lastname),"@rushi.com"))


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

RV
Regular Contributor
Regular Contributor

Is there a way to avoid email generation for a specific employee type?  I am looking for a syntax to for an 'else' block that does nothing.  OR, Do I need to list all types that are eligible for email generation, so that way if a type is missing it does not generate the email?

AshishDas
Regular Contributor II
Regular Contributor II

You can write an Advance query mentioning the conditions. You can use case statements in SQL to achieve that along with an else condition.

OR

For users imported through csv or via a target (Oracle, Workday etc), you can restrict email generation for all users during import and further via User Update rule you can mention the condition which will generate users' email for a selected kind after import.

For users created via form, email generation can only be restricted via an Advanced SQL query

It depends right, If you have different logic to generate for different type of users then you may have to list all and omit the one that you don't need.

Otherwise you can try using case when condition in advanced query


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

You can mention else as ''


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