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

How to fetch user's manager email in email template which is getting triggered through analytics

Ajit
New Contributor III
New Contributor III

Hi Team,

We have configured a notification that is triggered through analytics to each user separately, we want to add the user's manager email id in the TO/CC field. Could you please tell us which parameter we can use for this?

Thanks

16 REPLIES 16

CR
Regular Contributor III
Regular Contributor III

@Ajit  try below like attribute with your mail id

cc : ${manager.email},abc@gmail.com


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

Ajit
New Contributor III
New Contributor III

@CR  Thank you for the response, tried but not working. The email is not getting triggered.

CR
Regular Contributor III
Regular Contributor III

@Ajittry

${owner.email},


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

Ajit
New Contributor III
New Contributor III

@CR not working. The email template is tagged in an analytics. We tried some parameter from the documentation but not working.

CR
Regular Contributor III
Regular Contributor III

@Ajit i tried , am getting mails also above thing.

try like below prepare  query , based below sql we are getting manager mail example

select u.username as 'UserUsername',u.displayname as 'Displaynameee',u.EMPLOYEETYPE,u.companyname,DATE_FORMAT(u.startdate,'%Y-%m-%d') AS 'Startdte',DATE_FORMAT(u.enddate,'%Y-%m-%d') AS 'enddte',u.departmentname,u.country,um.username as Username,um.email as 'ManagerEmail' from users u , users um where u.manager=um.userkey and u.statuskey=1 and DATE_FORMAT(u.enddate,'%Y-%m-%d') = DATE_ADD(CURRENT_DATE(),INTERVAL +3 DAY)

and cc you include based ManagerEmail email column

like ${ANALYTICSDATA.'ManagerEmail'[0]}


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

Ajit
New Contributor III
New Contributor III

@CR  ${owner.email} is this working for you?? if yes - are you also fetching the user's manager email in the analytics query?

 

CR
Regular Contributor III
Regular Contributor III

without query its working.


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

Ajit
New Contributor III
New Contributor III

@CR  Is there anything I am missing? please suggest

Ajit_1-1708348438750.png

 

 

CR
Regular Contributor III
Regular Contributor III

@Ajit 

${owner.email},ajith@gmail.com

like below

CR_0-1708348953002.png

 


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

To get what variables are present to use in the email template, check 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:


${this.binding.variables.each {k,v -> println "$k = $v" + "" + "br" + ">"}}


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

Ajit
New Contributor III
New Contributor III

@CR @rushikeshvartak  We tried with - ${ANALYTICSDATA.'ManagerEmail'[0]}, its triggering the emails to user's manager.

But, if multiple users are coming as the outcome of the analytics query, then email to all users are triggering only when we are writing the parameter like below in the to/cc field of the email template:

${ANALYTICSDATA.'ManagerEmail'[0]}, xyz@abc.com

It's triggering to only one user if we are using as below: 

${ANALYTICSDATA.'ManagerEmail'[0]}

Could you please suggest what could be the reason here?

CR
Regular Contributor III
Regular Contributor III

@Ajit  - your question it should trigger all manager right, am correct?


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

Ajit
New Contributor III
New Contributor III

@CR yes for example if 3 users are coming in analytics, it should trigger to all 3 users ccing their manager.

It's working this way but only when we are adding a static email along with ${ANALYTICSDATA.'ManagerEmail'[0]}.

CR
Regular Contributor III
Regular Contributor III

try  below and confirm

CR_0-1708415963930.png


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

Ajit
New Contributor III
New Contributor III

@CR  We tested in the same way as you have mentioned above, but instead of 3 emails(to all users who are part of analytic outcome) only one email is getting triggered.

It's triggering to all users, only if we are using like below:

Ajit_0-1708416424785.png

 

CR
Regular Contributor III
Regular Contributor III

mail will get manager inbox , can you check user manager mails please
To : ${userEmail}
Cc : ${ANALYTICSDATA.'ManagerEmail'[0]}


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