No ratings
sudeshjaiswal
Saviynt Employee
Saviynt Employee

Use Case


How to send out emails from analytics depending on the results of the analytics. In this use case, we're going to send a separate email to each user record of the analytic report. 
 

Pre-requisites


Email Template and Analytics

Applicable Version(s)


All
 

Solution

 

Please follow the below steps: 

a) Create an Analytic Report

  • Ensure the Analytic report contains a column called USERNAME. 
  • Ensure each row has a unique USERNAME (only one record per username), you can use the group_concat()  function based on your usecase. 
  • Example Analytic Query: 
SELECT DISTINCT u.username           AS USERNAME,
                Count(ua.accountkey) AS 'Count of Accounts in SSM'
FROM   users u,
       user_accounts ua
WHERE  u.userkey = ua.userkey
       AND u.userkey IN ( 12, 13 ) -- Test Data
GROUP  BY u.username

b) Modify the Email template used in the Analytic report

  • Set the Email 'To' field to: ${userEmail}
  • In the body of the email, use the  {$ANALYTICSDATA} and {$ANALYTICSDATAMAP} variables.  

sudeshjaiswal_0-1691389804274.png

  • You can also use ${ANALYTICSDATAMAP.get("REPLACE_COLUMNNAME_FROM_REPORT")}  to get column-specific data.

Results Example

Analytic Report Result: 

sudeshjaiswal_1-1691389846660.png

Three separate emails were sent out for all three records in the report: 

sudeshjaiswal_2-1691389890057.png

Note: The email will be sent to the email of users mapped with username is result.

References

https://docs.saviyntcloud.com/bundle/EIC-Admin-v23x/page/Content/Chapter13-Access-Requests/ars-set-u... 

Version history
Last update:
‎08/22/2023 06:31 AM
Updated by: