We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

Send analytic email to particular email address

Harish7
New Contributor II
New Contributor II

Hi,

I have configured email for analytic report which get some specific accountnames of users.

Screenshot 2022-08-15 at 15.46.08.png

When i try to send this email using ${userEmail} - It works

But if the emails has to be sent to one single email address(harish.gandepalli@xyz.com) - its not working.

Is there any way to fix this?

Best regards

Harish

6 REPLIES 6

rushikeshvartak
All-Star
All-Star

what is error in logs ?

Did you enabled below config in Global Configuration

Group emails by username

When this option is enabled, the analytics emails sent during control execution will be grouped based on the username else every user will receive separate emails for every line item

rushikeshvartak_0-1660574616425.png

can you try ${userEmail},email@gmail.com or try in cc/bcc


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Harish7
New Contributor II
New Contributor II

Hi @rushikeshvartak ,

Thanks for the quick response.

Yes its working if we send like this -  ${userEmail},email@gmail.com or in cc/bcc

but the customer doesn’t want to sent emails to users but only to a particular email address(email@gmail.com) . Is there any way to avoid ${userEmail} and send only to email@gmail.com

Logs:

2022-08-15 14:52:33,482 [https-jsse-nio-443-exec-2091] DEBUG analytics.AnalyticsESService - Error in notifyEmailToOwner::
groovy.lang.MissingPropertyException: No such property: ANALYTICSDATA for class: SimpleTemplateScript399686
at SimpleTemplateScript399686.run(SimpleTemplateScript399686.groovy:1)
at com.saviynt.ecm.analytics.AnalyticsESService.notifyEmailToOwner(AnalyticsESService.groovy:2513)
at com.saviynt.ecm.analytics.AnalyticsHistoryESController$_closure3.doCall(AnalyticsHistoryESController.groovy:282)
at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)
at com.saviynt.webservice.SaviyntRestAuthenticationFilter.doFilter(SaviyntRestAuthenticationFilter.groovy:145)
at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:62)
at grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.java:59)
at com.mrhaki.grails.plugin.xframeoptions.web.XFrameOptionsFilter.doFilterInternal(XFrameOptionsFilter.java:69)
at com.brandseye.cors.CorsFilter.doFilter(CorsFilter.java:82)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2022-08-15 14:52:33,483 [https-jsse-nio-443-exec-2091] DEBUG println.PrintlnToLogger - Println :: | Error groovy.lang.MissingPropertyException: No such property: ANALYTICSDATA for class: SimpleTemplateScript399686

 

Best regards

Harish

In that case you can send full file instead of individual email or requirement is send file content in email body? 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

angela
New Contributor III
New Contributor III

We are working on a project with the requirement to send the file content in the email body and have tried what Harish did as well which returned the same error: Error groovy.lang.MissingPropertyException: No such property: ANALYTICSDATA for class: SimpleTemplateScript

and also tried ${ANALYTICSDATA} but found the variable is just replaced with whitespace.

Try ANALYTICSDATAMAP 

Refer example 5 : https://saviynt.freshdesk.com/support/solutions/articles/43000622153-managing-email-templates 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

angela
New Contributor III
New Contributor III

I have a ticket open related to this but here is my workaround for the time being:

Add this to your select statement: 

'username you want the email to send to' as 'username'

In my use case I have:

SELECT triggername as 'Trigger Name', systemname as 'System Name', jobname as 'Job Name', jobstartdate as 'Start Date', jobenddate as 'End Date', savresponse as 'Sav Response', 'ServiceNow' as 'username'
FROM EcmImportJob 

 

and then in the email template I have

To: ${userEmail}

Body:

<table>
<tr>
<th>Trigger Name</th>
<th>System Name</th>
<th>Job Name</th>
<th>Job Start Date</th>
<th>Job End Date</th>
<th>Response</th>
</tr>
<% int count=Integer.parseInt("${ANALYTICSDATA.ServiceNow.size()}"); for(int i=0;i<count;i=i+1){%>

<tr>
<td>${ANALYTICSDATA.'Trigger Name'[i]}</td>
<td>${ANALYTICSDATA.'System Name'[i]}</td>
<td>${ANALYTICSDATA.'Job Name'[i]}</td>
<td>${ANALYTICSDATA.'Start Date'[i]}</td>
<td>${ANALYTICSDATA.'End Date'[i]}</td>
<td>${ANALYTICSDATA.'Sav Response'[i]}</td>
</tr>
<% } %>
</table>