Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/01/2022 11:07 AM
In the email template, to address I need to write conditional logic where a particular group suppose XYZ@gmail.com should be notified with email only if the requestor raises the request for those entitlements that starts with ERP.
I had tried below expression in to part part but the email is not triggering.
<% if (entitlement_value in ('ERP_BAC_Analytics','ERP_ABC_Analytics','ERP_XYZ_Analytics') and (entitlementtypekey=25 and status=1)) print "XYZ@gmail.com" %>
This above expression is throwing the below error:
{"log":"2022-09-01 14:56:56,152 [quartzScheduler_Worker-3] ERROR services.ArsTaskService - Error while sending email - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed:\n","stream":"stdout","time":"2022-09-01T14:56:56.152328562Z"}
Can any one please suggest how can I acheive it?
NOTE: I am triggering this email in the ENDPOINT level for Add Access and Task completion.
09/01/2022 11:43 AM - edited 09/01/2022 12:05 PM
Can you try below
${entitlement_values.collect{it.toString()}.toListString().replaceAll('\\[|\\]','').startsWith('ERP_')}
09/05/2022 07:07 AM
Hi rushikesh,
I tried with your given query but the mail is not triggering.
The below way I tried in To part of email.
<% if ${entitlement_values.collect{it.toString()}.toListString().replaceAll('\\[|\\]','').startsWith('ERP_')} print "XTZ@gmail.com"%>
Can you please help me out with any other alternative approach.
09/05/2022 09:06 AM - edited 09/05/2022 09:07 AM
09/04/2022 10:57 PM
@Souvik
We can only use groovy/string functions and methods in email templates. 'IN' is not a function/method for groovy/java which is why you see the message.
Use a method like contains.
09/05/2022 06:29 AM
Hi Sahaj,
Can you please suggest for the requirement what function should we use?
09/05/2022 06:30 AM
Did you tried solution shared above?