02/01/2023 12:15 AM
Hello Team,
I would like to understand if there any option to include all the reportee's of a manager in a single email. There is a FreshDesk article explains this process but it doesnt work in our case since we are still at V5.5 SP3 product version. https://saviynt.freshdesk.com/support/solutions/articles/43000622153-managing-email-templates#Managi...
Please let me know if there is any other way to achieve this use case in Saviynt Version V5.5 SP3.
Thank you in advance for your insights on this.
Regards,
Suresh V.
02/01/2023 03:44 AM - edited 02/01/2023 03:45 AM
Hi Suresh,
Can you help clarify the requirement?
Do you want to send an email to manager with all their reportee's information in one single email? (or)
Do you want to send an email to manager with all their reportee's information in separate emails (one reportee info per email)?
-Siva
02/01/2023 11:21 PM
Hi @Sivagami ,
The requirement here is to trigger a notification to manager with all his reportee's listed.
For Ex: If manager A is having 10 reportees reporting to him, Then he should get 1 single email with all his reportee's.
I could see using FOR loop in email template this can be achieved, but there is a limitation in Saviynt version. (available from Release v2020.1 and v5.5 SP5 onwards)
02/01/2023 06:33 AM
If you just want to send a report of all users who are reporting to a manager. You can use analytics report with email notification. But if you have different use case to tigger this email please help us understand your use case/ requirement
02/01/2023 11:23 PM
Hi @sk
The requirement here is to trigger a notification to manager with all his reportee's listed.
For Ex: If manager A is having 10 reportees reporting to him, Then he should get 1 single email with all his reportee's.
I could see using FOR loop in email template this can be achieved, but there is a limitation in Saviynt version. (available from Release v2020.1 and v5.5 SP5 onwards)
Our current version is V5.5 sp3
02/02/2023 01:49 AM
Its working for me in v5.5 whats error are you getting
02/07/2023 02:04 AM
@rushikeshvartak I could see no error logged in the logs as multiple emails are getting triggered but the requirement is to trigger a group email
I'm using below syntax in email template and its triggering multiple emails to managers with reportee's details. for ex if i have 2 reportee's reporting to me then i'm receiving 2 different email with user details.
Hi ${ANALYTICSDATA.MANAGER[0]},
Please find the monthly report of the details of all your reportees.
<table>
<tr>
<th>Reportee ID</th>
<th>Reportee Email</th>
<th>Title</th>
<th>City</th>
<th>Start Date</th>
</tr>
<% int count=Integer.parseInt("${ANALYTICSDATA.MANAGER.size()}"); for(int i=0;i<count;i=i+1){%>
<tr>
<td>${ANALYTICSDATA.'REPORTEE ID'[i]}</td>
<td>${ANALYTICSDATA.'REPORTEE EMAIL'[i]}</td>
<td>${ANALYTICSDATA.'TITLE'[i]}</td>
<td>${ANALYTICSDATA.'CITY'[i]}</td>
<td>${ANALYTICSDATA.'START DATE'[i]}</td>
</tr>
<% } %>
</table>
Now,As per freshdesk article this syntax should trigger one single email with list of all the reportees. So i should get only one email with list of 2 user details.
02/07/2023 03:27 AM
Enable global configuration to Group by username under analytics
02/07/2023 11:05 PM
02/07/2023 11:08 PM
And also i have configured ${userEmail} in TO as FD states that it is mandatory to have useremail in To field.
To use ${ANALYTICSDATA} or ${ANALYTICSDATAMAP} in Analytics Emails, it is mandatory to have ${userEmail} in the TO of the email template.
02/08/2023 06:26 AM
Can you please share the query you have used?
02/08/2023 10:34 PM
Here is the query which lists down the reportees.
select
u.username as USERNAME,
u.firstname as FIRSTNAME,
u.lastname as LASTNAME,
u.enddate as ENDDATE,
u.email as EMAIL,
a.validthrough as ACCENDDATE,
u1.email as MANAGEREMAIL,
u1.username as MANAGERNAME
from users u
join users u1 on u.manager=u1.userkey
JOIN USER_ACCOUNTS UA ON U.USERKEY=UA.USERKEY JOIN ACCOUNTS A ON UA.ACCOUNTKEY = A.ACCOUNTKEY
JOIN ENDPOINTS E ON A.ENDPOINTKEY = E.ENDPOINTKEY
WHERE U.STATUSKEY=1
AND A.STATUS in('1','Manually Provisioned')
AND A.VALIDTHROUGH IS NOT NULL AND U.EMPLOYEETYPE = 'Managed Contractor'
AND E.ENDPOINTKEY IN (SELECT ENDPOINTKEY FROM ENDPOINTS WHERE ENDPOINTNAME in ('AD ABC','AD ABPG'))
AND U.regioncode='NAZ'
AND (DATE(u.enddate) <CURDATE())
Email Template
Hi ${ANALYTICSDATA.MANAGERNAME[i]},
Please find the monthly report of the details of all your reportees.
<table>
<tr>
<th>USERNAME</th>
<th>ENDDATE</th>
<th>FIRSTNAME</th>
<th>LASTNAME</th>
<th>EMAIL</th>
</tr>
<% int count=Integer.parseInt("${ANALYTICSDATA.MANAGERNAME.size()}"); for(int i=0;i<count;i=i+1){%>
<tr>
<td>${ANALYTICSDATA.'USERNAME'[i]}</td>
<td>${ANALYTICSDATA.'ENDDATE'[i]}</td>
<td>${ANALYTICSDATA.'FIRSTNAME'[i]}</td>
<td>${ANALYTICSDATA.'LASTNAME'[i]}</td>
<td>${ANALYTICSDATA.'EMAIL'[i]}</td>
</tr>
<% } %>
</table>
02/09/2023 06:10 AM
Change query like below
select
u.username as USER_ID,
u.firstname as FIRSTNAME,
u.lastname as LASTNAME,
u.enddate as ENDDATE,
u.email as EMAIL,
a.validthrough as ACCENDDATE,
u1.email as MANAGEREMAIL,
u1.username as USERNAME
from users u
join users u1 on u.manager=u1.userkey
JOIN USER_ACCOUNTS UA ON U.USERKEY=UA.USERKEY JOIN ACCOUNTS A ON UA.ACCOUNTKEY = A.ACCOUNTKEY
JOIN ENDPOINTS E ON A.ENDPOINTKEY = E.ENDPOINTKEY
WHERE U.STATUSKEY=1
AND A.STATUS in('1','Manually Provisioned')
AND A.VALIDTHROUGH IS NOT NULL AND U.EMPLOYEETYPE = 'Managed Contractor'
AND E.ENDPOINTKEY IN (SELECT ENDPOINTKEY FROM ENDPOINTS WHERE ENDPOINTNAME in ('AD ABC','AD ABPG'))
AND U.regioncode='NAZ'
AND (DATE(u.enddate) <CURDATE())
ORDER BY USERNAME;
And email template as below
Hi ${ANALYTICSDATA.USERNAME[i]},
Please find the monthly report of the details of all your reportees.
<table>
<tr>
<th>USER_ID</th>
<th>ENDDATE</th>
<th>FIRSTNAME</th>
<th>LASTNAME</th>
<th>EMAIL</th>
</tr>
<% int count=Integer.parseInt("${ANALYTICSDATA.USERNAME.size()}"); for(int i=0;i<count;i=i+1){%>
<tr>
<td>${ANALYTICSDATA.'USER_ID'[i]}</td>
<td>${ANALYTICSDATA.'ENDDATE'[i]}</td>
<td>${ANALYTICSDATA.'FIRSTNAME'[i]}</td>
<td>${ANALYTICSDATA.'LASTNAME'[i]}</td>
<td>${ANALYTICSDATA.'EMAIL'[i]}</td>
</tr>
<% } %>
</table>
02/07/2023 11:52 PM
Hi @rushikeshvartak ,
May i know which service pack in V5.5 version you are referring to ?