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

Facing issue in sending email via analytics

Bhargav
New Contributor
New Contributor

Hi,

We have a requirement where we need to send an email to the user's manager that their reportee's AD account will be deleted in 14 days. Their deletion policy is 60 days so I am sending an email 44 days after the enddate of the user. 

I am getting the following error: 

"groovy.lang.MissingPropertyException: No such property: ANALYTICSDATAMAP for class: SimpleTemplateScript135 at SimpleTemplateScript135.run(SimpleTemplateScript135.groovy:1) at com.saviynt.ecm.analytics.AnalyticsESService.notifyEmailToOwner(AnalyticsESService.groovy:2677) at com.saviynt.ecm.analytics.AnalyticsESService.emailAction(AnalyticsESService.groovy:16630) at com.saviynt.ecm.analytics.AnalyticsESService.doFileArchivalAndSendEmail(AnalyticsESService.groovy:14802) at com.saviynt.ecm.analytics.AnalyticsESService$_runControl_closure211_closure322.doCall(AnalyticsESService.groovy:14634) at com.saviynt.ecm.analytics.AnalyticsESService$_runControl_closure211.doCall(AnalyticsESService.groovy:14633) at java.lang.Thread.run(Thread.java:750)"

Query:

select u.firstname as 'UserFirstname',u.lastname as 'UserLastname',m.username as USERNAME,m.firstname as 'Firstname',m.lastname as 'Lastname',u.enddate as 'Termination' from users u join users m on u.manager=m.userkey where u.statuskey=1 and u.employeetype='External' and (datediff(u.enddate,date(now())) > 13 and datediff(u.enddate,date(now())) < 15)

 

In TO field I'm using ${userEmail}

Can anyone suggest me how can we resolve this issue?

TIA.

Bhargav.

14 REPLIES 14

Manu269
All-Star
All-Star

Refer this post : https://forums.saviynt.com/t5/identity-governance/report-to-manager-reportee-end-date-is-approaching...

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

Hi,@Manu269 , 

I have enabled that option and also even if i use the simple static body, still email is not getting triggered.

Bhargav_1-1723040854521.png

 

Bhargav_0-1723040695119.png

 

rahul_p
Regular Contributor III
Regular Contributor III

Hello @Bhargav ,

Is from address is correct? I see the default address only there, please check and use as per your SMTP server configuration.

Regards,
Rahul
Please accept this as solution & give kudos if it resolves your issue.

Hi @rahul_p , Yes it's correct.

Raghu
All-Star
All-Star

@Bhargav 

try below query and html template shud be check in Advanced HTML CSS

select u.username,u.firstname as 'UserFirstname',u.lastname as 'UserLastname',m.username as USERNAME,m.firstname as 'Firstname',m.lastname as 'Lastname',u.enddate as 'Termination' from users u join users m on u.manager=m.userkey where u.statuskey=1 and u.employeetype='External' and (datediff(u.enddate,date(now())) > 13 and datediff(u.enddate,date(now())) < 15)


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

rushikeshvartak
All-Star
All-Star

Please validate supported variables.

Purpose :

To get what variables are present to use in the email template.

Email Template steps :

keep Advanced HTML CSS flag is checked

Keep your email Address in TO

TO /CC/BCC & Subject - Don't use any dynamic variables

Add only below code in Email Body
${this.binding.variables.each {k,v -> println "$k = $v" + "" + "br" + ">"}}

Output : using the below expression. By putting it in the email body, it will print all variable names with values, and then accordingly, you can use it:


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

Abhishek0406
New Contributor III
New Contributor III

Abhishek0406_0-1723096884581.png

Uncheck this option in Global config > Analytics and then give it a try.

Also try below Query too:

select u.firstname as 'UserFirstname',u.lastname as 'UserLastname',m.username as USERNAME,m.firstname as 'Firstname',m.lastname as 'Lastname' from users u join users m on u.manager=m.userkey where u.statuskey=1 and u.employeetype='External' and (datediff(u.enddate,date(now())) > 13 and datediff(u.enddate,date(now())) < 15)

 

I have removed u.enddate as 'Termination' from select part of the query.

Bhargav
New Contributor
New Contributor

Hi,

Can anyone please send me the sample working email template for analytics?

 

Refer https://forums.saviynt.com/t5/saviynt-knowledge-base/leverage-analytics-to-send-mails-to-users-indiv...


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

Abhishek0406
New Contributor III
New Contributor III

<table cellpadding="0" cellspacing="0" width="588" align="center" style="margin:0 auto;padding:0;"> </tr> <tr valign="top"> <td> <table cellpadding="0" cellspacing="0" width="588" style="background: #A0998B; margin: 0; padding: 0; text-align: left;" align="left"> <tr align="right"> <td height="0" width="20"> </td> <td valign="bottom"> <h1 style="color: #A0998B; margin: 0; padding: 0; font: bold 11pt Arial, Helvetica, sans-serif; text-transform: uppercase;"> </h1> </td> </tr> <tr valign="middle"> <td height="85" width="30"> </td> <td> <p style="color: #ffffff; margin: 5; padding: 0; font: 22pt Arial, Helvetica, sans-serif;padding:0"> IGA | Leaver ${ANALYTICSDATAMAP.get("endusername")} deactivated in 2 weeks <br> </p> </td> </tr> </table> <table cellpadding="0" cellspacing="0" width="586" style="background:#fff;margin:0;padding:0;text-align:left;"> <tr valign="top"> <td colspan="3" height="20"> </td> </tr> <tr valign="top" bgcolor="#f6f5f1"> <td style="padding:20px"> <p style="margin:0;padding:0;color:#333;font:10pt Arial;line-height:15pt;"> Dear Manager(s), <br><br> Please note that the AD login account for ${ANALYTICSDATAMAP.get("enduserfirstname")} ${ANALYTICSDATAMAP.get("enduserlastname")} will be deactivated in 2 weeks from today as part of the leaver procedure. Please find more details below. <br> <br> <b>Name of leaver:</b> ${ANALYTICSDATAMAP.get("enduserfirstname")} ${ANALYTICSDATAMAP.get("enduserlastname")}<br> <b>username:</b> ${ANALYTICSDATAMAP.get("endusername")}<br> <b>Last working day:</b> ${ANALYTICSDATAMAP.get("enddate")}<br> <br> As part of our offboarding process, it is essential to transfer ownership of access rights (e.g. AD groups and service accounts) before an employee departs from Company. You may access the guide for transferring ownership in Saviynt <a href="">here</a>. Please ensure that this task is completed as part of the employee handover tasks. Failure to complete this transfer will result in automatic re-assignment of access ownerships to the direct manager. <br><br> Please contact your HR team if the above information is incorrect in Workday. <br> </p> </td> </tr> </table> </td> <td width="10"> </td> </tr> <tr valign="top"> <td colspan="3" align="center" style="padding:5px"> <p style="font:normal 8pt Arial;line-height:12pt"> This email was generated automatically, please do not reply.<br> For more information, please contact your IT Service Desk.<br> Copyright © 2024 | Group </p> </td> </tr> </table>

You can refer above template body, It works for us.

Bhargav
New Contributor
New Contributor

Hi Team,

With the below configuration, i'm getting the error.

<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable"> <tr> <td align="center" valign="top"> <!--Email standard is 600 width, 800 at the upper limit - However this will be 900--> <table border="0" cellpadding="10" cellspacing="0" width="900" id="emailContainer"> <tr> <td colspan="2"> <div style="font-family: 'URW Geometric', sans-serif; font-size: 15px;"> Dear ${ANALYTICSDATAMAP.get("Firstname")} .</div> </td> </tr> </table> </td> </tr> </table> <!-- https://templates.mailchimp.com/development/html/ thanks-->

 

Error:

groovy.lang.MissingPropertyException: No such property: lastAnalyticsHistoryKey for class: com.saviynt.ecm.analytics.AnalyticsESService at com.saviynt.ecm.analytics.AnalyticsESService.notifyEmailToOwner(AnalyticsESService.groovy:2465) at com.saviynt.ecm.analytics.AnalyticsESService.emailAction(AnalyticsESService.groovy:16630) at com.saviynt.ecm.analytics.AnalyticsESService.doFileArchivalAndSendEmail(AnalyticsESService.groovy:14802) at com.saviynt.ecm.analytics.AnalyticsESService$_runControl_closure211_closure322.doCall(AnalyticsESService.groovy:14634) at com.saviynt.ecm.analytics.AnalyticsESService$_runControl_closure211.doCall(AnalyticsESService.groovy:14633) at java.lang.Thread.run(Thread.java:750)

Abhishek0406
New Contributor III
New Contributor III

Try with a basic Email template
TO: ${userEmail}

Subject: Analytics Email Test for ${ANALYTICSDATAMAP.get("UserFirstname")}

Body: TEST

Recreate analytics report with different name


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