and more in a single search tool across platforms. Read the announcement here. |
02/15/2024 10:33 PM - edited 02/15/2024 11:00 PM
Hi Team or @rushikeshvartak @Dhruv_S @Manu269 ,
We are trying to create an email template for analytics which should fetch the info from analytics but that doesnt seem to be working I see below errors in the logs. can anyone help me how this can be fixed?
Thank you,
Harsha
Solved! Go to Solution.
02/15/2024 11:19 PM
Share result
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" + ">"}}
02/15/2024 11:44 PM - edited 02/15/2024 11:48 PM
Hi rushikesh,
I had tried that it gives below result just totalrecord n analyticsconfig:
if I give ANALYTCSDATA it is throwing no such property error. Is it not supported in latest version? Please let me know if you have any sample that I can refer and replicate.
02/15/2024 11:31 PM
@Harsha what info need to print and template post ? will check and confirm
02/16/2024 02:40 AM - edited 02/16/2024 03:24 AM
Hi @CR, @rushikeshvartak ,
Below is the sample template used in advanced HTML and CSS:
<html> <table style="background-color: #eeeeee;margin-left: auto;margin-right: auto;"> <tbody> <tr> <td style="background-color: #eeeeee;"> <table width="80%" align="center"> <tbody> <tr> <td style="height: 3px; background-color: #eeeeee;"></td> </tr> <tr> <td style="color: white; font-size: 24px;padding-top: 30px; padding-left: 24px; height: 130px;" bgcolor="#006050" width="10%"> <p style="font-family:Verdana; font-size: 30px; margin: 0px;padding-top: 20px"> <strong>Company logo <strong></p> <p style="font-family:arial;color: #ffffff;font-size: 15px;"> Guest Account Expiry Notification <p style="font-family:arial;color: #00cccc;font-size: 15px;margin-top: -1em"><br>Action Required by Manager</p> <br/> </td> </tr> <tr> <td style="height: 8px; background-color: #eeeeee;"></td> </tr> <tr> <td style="padding: 20px; font-size: 14px;" bgcolor="white"> <p style="font-family:arial">Hi Account responsible person, <br><br> This is a reminder that the Guest Account below that reports to you is going to expire after 3 days.<br> <tr> <td style="font-family:arial;padding: 20px; font-size: 14px;" bgcolor="white"><hr color="#006050"> <p style="font-family:arial;color: #006050;font-size: 15px;"><b><u>Account Details:</u></b> <br><br> <table border="1" align="center" > <tr > <th style="background-color:#006050;color: #ffffff">   Account Name   </th><td>   ${ANALYTICSDATA.'UserUsername'[0]}  </td></tr> <tr><th style="background-color:#006050;color: #ffffff">   Display Name   </th><td>  ${ANALYTICSDATA.'Displaynameee'[0]}  </td></tr> <tr><th style="background-color:#006050;color: #ffffff">   Account Expiry date   </th><td>  ${ANALYTICSDATA.'enddte'[0]}   </td></tr><tr> <th style="background-color:#006050;color: #ffffff">   Account Expires in days   </th> <td>   3  </td></tr> <tr></table> <p /> <br> <hr color="#006050"> <p style="font-family:arial;color: #006050;font-size: 15px;"><p style="font-family:arial;color: #006050;font-size: 15px;"> </td> </tr> <td style="color: white; font-size: 24px; padding-left: 5px; height: 35px;" bgcolor="#A8A9AB" width="25%"/> <p style="font-family:Verdana; font-size: 10px; margin: 0px;padding: 10px"><strong>©Company logo 2024</strong></p> <tr> </tr> </tbody> </table> </td> </tr> </tbody> </table> </html>
02/16/2024 05:59 AM
@Harsha you template not correct look like and send me correct html and Query also
if you going to create new template please check enable Advanced HTML/CSS
02/18/2024 09:24 PM
02/18/2024 09:38 PM
@Harsha Most of the times "  " this special character got printed in template
02/18/2024 09:56 PM - edited 02/18/2024 10:02 PM
Hi @CR,
Thank you for pointing that out but I believe culprit is ANALYTICSDATA in the logs. I want the solution for that why it says no sucg property?
@rushikeshvartak do you have any clue why this is occuring?
Thank you,
Harsha
02/18/2024 10:01 PM
@Harsha send me you report query and it is exiting template or new ? if new did you enable Advanced HTML/CSS ?
02/18/2024 10:08 PM
Hi,
yes advanced is enabled. For same report email template is attached. Below is the report query:
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.EMPLOYEETYPE='****' and u.statuskey=1 and DATE_FORMAT(u.enddate,'%Y-%m-%d') = DATE_ADD(CURRENT_DATE(),INTERVAL +3 DAY)
Thanks,
Harsha
02/18/2024 11:06 PM
@Harsha try like below
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.EMPLOYEETYPE='****' and u.statuskey=1 and DATE_FORMAT(u.enddate,'%Y-%m-%d') = DATE_ADD(CURRENT_DATE(),INTERVAL +3 DAY)
02/18/2024 11:35 PM
Hi,
Yes I tried as above too, still issue is persistant.
Thank you,
Harsha
02/19/2024 12:31 AM - edited 02/19/2024 12:52 AM
@Harsha try below query , below highlighted column should add dont remove u.username
select u.username, 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 'MUsername',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)
02/19/2024 06:22 PM
username column alias should be in lower case,
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.employeetype = '****'
AND u.statuskey = 1
AND Date_format(u.enddate, '%Y-%m-%d') =
Date_add(CURRENT_DATE(), interval + 3 DAY)
02/19/2024 08:17 PM
Hi @rushikeshvartak ,
Thank you for replying tried that didnt work either. I consistently see the same issue. Groovy.lang.MissingProperty: ANALYTICSDATA . why would that be happening? any idea?
Thank you,
Harsha
02/19/2024 08:32 PM
Share report & email template config.
And make sure below is enabled in global config
02/19/2024 08:56 PM - edited 02/19/2024 08:58 PM
Hi @rushikeshvartak ,
yes group by username is enabled in global config. Also below email template is added after enabling the advanced HTML and CSS:
<html>
<style> ul,li{ font-family:arial; } .spelling-error{ text-decoration-line: underline; text-decoration-color: blue; color:blue } mark { background-color: yellow; color: black; } the, tde { border-style:solid; border-color: #96D4D4; background-color: white; padding: 20px; } </style>
<table style="background-color: #eeeeee;margin-left: auto;margin-right: auto;">
<tbody>
<tr>
<td style="background-color: #eeeeee;">
<table width="80%" align="center">
<tbody>
<tr>
<td style="height: 3px; background-color: #eeeeee;"></td>
</tr>
<tr>
<td style="color: white; font-size: 24px;padding-top: 30px; padding-left: 24px; height: 130px;" bgcolor="#006080" width="50%">
<p style="font-family:Verdana; font-size: 30px; margin: 0px;padding-top: 20px"> <strong>Company <strong></p>
<p style="font-family:arial;color: #ffffff;font-size: 15px;"> Company Account Expiry Notification
<p style="font-family:arial;color: #00cccc;font-size: 15px;margin-top: -1em"><br>Action Required by Line Manager</p>
<br/>
</td>
</tr>
<tr>
<td style="height: 8px; background-color: #eeeeee;"></td>
</tr>
<tr>
<td style="padding: 20px; font-size: 14px;" bgcolor="white">
<p style="font-family:arial">
Hi Account responsible person, <br><br> This is a reminder that the Company Account below that reports to you is going to expire after 3 days.<br>
<tr> <td style="font-family:arial;padding: 20px; font-size: 14px;" bgcolor="white"><hr color="#006080"> <p style="font-family:arial;color: #006080;font-size: 15px;"><b><u>Account Details:</u></b> <br><br> <table border="1" align="center" > <tr > <th style="background-color:#006080;color: #ffffff"> Account Name </th><td> ${ANALYTICSDATA.'UserUsername'} </td></tr> <tr><th style="background-color:#006080;color: #ffffff"> Display Name </th><td> ${ANALYTICSDATA.'Displaynameee'} </td></tr> <tr><th style="background-color:#006080;color: #ffffff"> Account Expiry date </th><td> ${ANALYTICSDATA.'enddte'} </td></tr><tr> <th style="background-color:#006080;color: #ffffff"> Account Expires in days </th> <td> 3 </td></tr> <tr></table> <p /> <br> <hr color="#006080"> </br>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</html>
and below is the report query:
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 ,um.email as 'ManagerEmail' from users u , users um where u.manager=um.userkey and u.EMPLOYEETYPE='*****' and u.statuskey=1 and DATE_FORMAT(u.enddate,'%Y-%m-%d') = DATE_ADD(CURRENT_DATE(),INTERVAL +3 DAY)
Thank you,
Harsha
02/19/2024 08:58 PM
Please provide screenshot, There is config issue
02/19/2024 09:58 PM
Hi @rushikeshvartak ,
I am not sure which config you meant but I have provided all of them please refer below screenshot:
Thank you,
Harsha
02/19/2024 10:08 PM
Please confirm analytics type is not runtime & save data option - need screenshots
02/19/2024 10:31 PM
Hi @rushikeshvartak ,
Thank you so much for helping me out.Analytics is not runtime. And yes save data was checked mark.Issue was solved with @CR's suggestion by not adding without aliasname to u.username
@CR thank you so much for the help.
Thank you,
Harsha
02/19/2024 09:26 PM
Please did you tried below query same as what ever i given ?
select u.username, 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 'MUsername',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)
Please try once let me know it work, i tested yesterday only
02/19/2024 10:46 PM
Hi @CR,
It does work but what if I want to send the mail to manager? what I need to do in that case?
Thank you,
Harsha
02/19/2024 10:50 PM
try cc in below binding variable and your mail should be include
${owner.email},Harsha@gmail.com
02/20/2024 06:06 AM
To : ${userEmail}
Cc : ${ANALYTICSDATA.'ManagerEmail'[0]}
02/20/2024 06:10 AM - edited 02/20/2024 06:11 AM
I am using ${owner.email} it working me, again i suggested below
To : ${userEmail}
Cc : ${ANALYTICSDATA.'ManagerEmail'[0]}