Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Send Analytic Report email to user that initiated it

MRitchie
New Contributor III
New Contributor III

Is there a way to configure the email template for an Analytic so that the output is sent to the user that kicked off the request?

I see references to ${USER} in the documentation but that doesn't appear to be available in this situation.

18 REPLIES 18

itinjic
Regular Contributor
Regular Contributor

Yes, there is a way to configure the email template for an analytics report so that the output is sent to the user who initiated the request. However, instead of using ${USER}, you can use ${userEmail} as the variable in the email template.

Here is an example of how you can configure the email template:

To: ${userEmail}
Subject: Your Analytics Report

Body:
Dear ${user.username},

Please find attached the Analytics Report that you requested.

Best regards,
Your Name

By using ${userEmail} in the "To" field of the email template, the email will be sent to the user who initiated the analytics report.

 

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

rushikeshvartak
All-Star
All-Star

You can only send report execution completion notification without attachment


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

MRitchie
New Contributor III
New Contributor III

So I had tried {userEmail} but it sent the report to all users in the data because I had a column called username.  I changed that column name and now it is just sending to the user that initiated, so I guess that variable name has two uses for Analytic Email Templates.

The variable (user.username} does not appear to be available in this scenario.

So I think that the outcome is, if you want to send to the user who initiated you can use {userEmail} provided username is not one of your returned fields.

Raghu
Valued Contributor III
Valued Contributor III

@MRitchie  can you share analytic report ss and query and are you using user contxt ?


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

MRitchie
New Contributor III
New Contributor III

This is the query

select u.username as officer, u.firstname, u.lastname, u.title, 'Entitlement' as objectType, ev.displayname as value, e.displayname as additional_information from endpoints e join entitlement_types et on et.endpointkey = e.endpointkey join entitlement_values ev on et.entitlementtypekey = ev.entitlementtypekey join entitlement_owners eo on ev.entitlement_valuekey = eo.entitlement_valuekey join users u on eo.userkey = u.userkey where upper(u.employeetype) = 'OFFICER' 

And here is the email template

To : ${userEmail}

This works and sends to the initiator but if I remove the 'as officer' from the query then it sends to each individual username. 

@MRitchie : That's expected, If you don't give alias to username column then it will send report to all individual users coming from report.


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

You can't send report attachment over email to person who ran report 


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

That is not what I am seeing when I set it up as I said above.  The user running the report from the UI is the one getting the email with the results attached

User only gets email if report contains large data. Please submit enhancements request on idea portal


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

@rushikeshvartak did you try with my example or similar query?  It only has 5 rows and 7 columns and the user running the report is receiving it.  Maybe something has changed but this is working as I would like it to.

Your query sending data to users who are in results. What i understand requirement is when someone running reports he should get data of all data from report over email or notification 


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

No, its not.  Because I changed the results set column from username to officer it only sends one report to the person that ran it.  If I change it back to username then yes it sends to each user in the report.  The {userEmail} variable appears to have different functions depending on if username is a returned column or not.

I am hardcoded as the CC on the email template so I can see exactly how many its sending.

That’s expected behavior 

username columns send per user vs other will send full report


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

Raghu
Valued Contributor III
Valued Contributor III

@MRitchie  you requiremnt email template also send user right? with attachemnt?


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

MRitchie
New Contributor III
New Contributor III

Correct, with {userEmail} and no username column in the results the user running the report is getting the email with results attached

Raghu
Valued Contributor III
Valued Contributor III

it is expected behavior @MRitchie 


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

MRitchie
New Contributor III
New Contributor III

Thank you @itinjic for sending me down the right path and then everyone else confirming that its expected behavior.  I didn't see this listed in the documentation as a way for the user that runs the report to get the email, if I missed it please share a link to this example.

So to summarize, if username is a column in the output data then its not possible (as this will send the email to each user in the result set) but if its not present then {userEmail} will send to the user that initiated the run of the analytic.

Provide feedback on documentation pages to append this finding 


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