Click HERE to see how Saviynt Intelligence is transforming the industry. |
10/24/2024 10:20 AM
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
10/24/2024 10:23 AM - edited 10/24/2024 10:30 AM
@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.
10/24/2024 10:28 AM
<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>