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

Need to send out multiple emails per user in analytics report

sb17gds
New Contributor III
New Contributor III

Hi team,

To explain the usecase, whenever a user gets terminated we want to send out mails to the servicedesk team to have a record of the termination.

Hence, the report is like this:

select u.username as 'USERNAME', u.email as 'EMAIL', u.employeeid as 'USEREMPLOYEEID', a.username as 'MANAGER', u.firstname as 'FIRSTNAME', u.lastname as 'LASTNAME', a.firstname as 'MFIRSTNAME', a.lastname as 'MLASTNAME', u.termdate as 'TERMDATE', SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(u.comments, '[', -1), ']', 1), '- ', -1), '-', 1) AS
'UCOMMENTS', u.comments as 'UCOMMENTS1' from users u, users a where u.manager = a.userkey and u.statuskey = 0 and u.comments like '%Certification%' and u.termdate >= NOW() - INTERVAL 1 HOUR

And since the email body is like this:

Please initiate a high risk termination for: ${ANALYTICSDATA.'EMAIL'}<br>Personnel Number: ${ANALYTICSDATA.'USEREMPLOYEEID'}<br>Name: ${ANALYTICSDATA.'FIRSTNAME'} ${ANALYTICSDATA.'LASTNAME'}<br>Supervisor: ${ANALYTICSDATA.'MANAGER'}<br>Supervisor Name: ${ANALYTICSDATA.'MFIRSTNAME'} ${ANALYTICSDATA.'MLASTNAME'}<br>Termination Date: ${ANALYTICSDATA.'TERMDATE'}<br>Terminated by: ${ANALYTICSDATA.'UCOMMENTS'}<br><br>${ANALYTICSDATA.'UCOMMENTS1'}<br><br>

the variable ${userEmail} is in the to field. 

A while ago, I had asked if there was a way to remove user's email from to field; so it was suggested to have 'ADMIN' as 'USERNAME'. However, that means that if within a timeframe, multiple people are terminated/match this condition, it is still only sending out one email. We need multiple emails per person.

Is there any way to achieve that? Even if we could display all the names in table form, or in the email body itself? Is that possible?

Thanks

2 REPLIES 2

NM
Honored Contributor III
Honored Contributor III

@sb17gds use a for loop to print all the details in a table format.

Sample 

<%int count=Integer.parseint(“${ANALYTICSDATA.App.size()}”); for(int i=0;i<count;i=i+1){%>

Or for multiple email 

You can uncheck a configuration in global configuration of saviynt

Config name

"Group email be username"

FYI it will apply to all analytics.


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

rushikeshvartak
All-Star
All-Star
  • If  you want to send 1 email to each user then enable group by username from global configuration
  • You can use below sample logic for looping

 

<table>

<tr><th>Application</th><th>Account name</th><th>Password expiry date</th></tr>

<%int count=Integer.parseint(“${ANALYTICSDATA.Application.size()}”); for(int i=0;i<count;i=i+1){%>

<tr><td>${ANALYTICSDATA.'Application'[i]}</td><td>${ANALYTICSDATA.'Account Name'[i]}</td><td>${ANALYTICSDATA.'Password Expiration Date'[i]}</td></tr><%}%>

</table>

 


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