Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/21/2024 03:00 AM
Filter New Joiner Email by EmployeeClass
Our requirement is to filter email for new joiners based on their EmployeeClass which can either be 'Employee' or 'Contractor'. we have added the email template under AD endpoint.
But Email is not getting triggered when we use the below query for new joiner as Email in the 'TO' section of email
TO: ${if(users?.EmployeeClass.equalsIgnoreCase('Employee')){user.email} else{manager.email}}
also tried many combinations
TO:${if(user?.employeeClass.equalsIgnoreCase('Employee')){user.email} else{manager.email}}
if EmployeeClass is 'Contractor'
then Email should be sent to the new users manager
else if EmployeeClass is 'Employee'
then Email should be sent to the new user itself
is something incorrect or missing in the query? the email is getting triggered when we hardcode the 'TO' to our own email address
Thanks
05/22/2024 03:17 AM
Please refer the below article and built the script to add in email template 'TO' section.
05/22/2024 07:05 AM
is it possible even if the attribute which we want to filter against is not present in the binding variables, as task type is present in binding variable but we are trying to filter by employeeclass which is not working with this query: <% if (user?.employeeclass == 'Employee') print "${manager?.email}" else if (user?.employeeclass == 'Contractor') print "${xxx@gmail.com}"%>'
if this is wrong syntax or is it possible to filter using employeeclass attribute
05/22/2024 08:50 PM
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" + ">"}}