03/15/2023 11:49 AM
Hi Expert,
I have a requirement where need to send an email upon gmail account creation and the condition is like if the user's manager hierarchy has a value of a specific manager something like the below
If the user has manager's hierarchy value has 50001193 then the email should get triggered, I have attached the below email template in endpoint for new account complete email. Any guidance here would be helpful.
===========
{
"Additional Email DNTL Employee's Manager for Gsuite": {
"bccfld": null,
"templatecontent": "<p> <\u002fp>\r\n <hr style=\"background-color:#3D3C3C;color:#3D3C3C;height:10px; width:100%\">\r\n <table>\r\n <tbody>\r\n <tr>\r\n <a name=\"en_anchor\"><\u002fa><hr id=\"space_header_en\" class=\"space_header\"><br><table id=\"banner_en\" class=\"banner\"><td><img src=\"XXX\" alt=\"xxxx\" width=\"122\" height=\"33\"><\u002ftd>\r\n <td> <\u002ftd>\r\n\t\t<td><img src=\"xxx\" alt=\"xxx\" width=\"10\" height=\"15\">EN | <a href=\"#fr_anchor\">FR<\u002fa><\u002ftd>\r\n <\u002ftr>\r\n <\u002ftbody>\r\n <\u002ftable>\r\n <table style=\"padding-left: 50px;\">\r\n <tbody>\r\n <tr>\r\n <td>\r\n\t\t<br>\r\n\t <p style=\"color:#49166d; font-family: Aria,sans-serif;font-size: 16pt;\">Action Required for Do Not Touch List (DNTL) Team Members<\u002fp>\r\n <p style=\"color:#333; font-family: Aria,sans-serif;font-size: 10.5pt;\">If you are working with Do not touch list customer data (DNTL) you will have to complete an AccesNow request to have a Microsoft Exchange email account created instead of a Gmail account. In <a href=\"http://go/AccessNow\">go/AccessNow<\u002fa>choose to update user request, choose username, select mailbox type and provide business justification.<\u002fp> \r\n <p style=\"color:#333; font-family: Aria,sans-serif;font-size: 10.5pt;\">Please Review the <a href=\"xxx\">DNTL Guidelines<\u002fa> before proceeding with the request.\r\n <\u002ftd>\r\n <\u002ftr>\r\n <\u002ftbody>\r\n <\u002ftable> <br>\r\n <hr> <br><br>\r\n <hr style=\"background-color:#3D3C3C;color:#3D3C3C;height:10px; width:100%\">\r\n <table>\r\n <tbody>\r\n <tr>\r\n\t <a name=\"fr_anchor\"><\u002fa><hr id=\"space_header_fr\" class=\"space_header\"><br><table id=\"banner_fr\" class=\"banner\"><td><img src=\"xxx\" alt=\"xxx\" width=\"122\" height=\"33\"><\u002ftd>\r\n <td> <\u002ftd>\r\n <td>\r\n <img src=\"xxxx\" alt=\"xxxx\" width=\"10\" height=\"15\"><a href=\"#en_anchor\">EN<\u002fa> | FR<\u002ftd>\r\n <\u002ftr>\r\n <\u002ftbody>\r\n <\u002ftable>\r\n <table style=\"padding-left: 50px;\">\r\n <tbody>\r\n <tr>\r\n <td>\r\n\t\t<p> <\u002fp>\r\n <p style=\"color:#49166d; font-family: Aria,sans-serif;font-size: 16pt;\">Action requise pour Do Not Touch List (DNTL) Membres de l'équipe<\u002fp>\r\n <p style=\"color:#333; font-family: Aria,sans-serif;font-size: 10.5pt;\">Si vous travaillez avec des données clients de la liste Do not touch (DNTL), vous devrez remplir une demande AccessNow afin de créer un compte e-mail Microsoft Exchange au lieu d'un compte Gmail. Dans <a href=\"xxx">go/AccessNow<\u002fa>choisissez de mettre à jour la demande de l'utilisateur, choisissez le nom de l'utilisateur, sélectionnez le type de boîte aux lettres et fournissez une justification.<\u002fp>\r\n <p style=\"color:#333; font-family: Aria,sans-serif;font-size: 10.5pt;\">Veuillez consulter les <a href=\"xxx\">directives DNTL<\u002fa> avant de procéder à cette demande.<\u002fp>\r\n <\u002ftd>\r\n <\u002ftr>\r\n <\u002ftbody>\r\n <\u002ftable>\r\n <br><hr>",
"contentAsHtml": true,
"tofld": "<%if(users?.customproperty12.contains('50043222') || users?.customproperty12.contains('50043221')){print \"${manager?.email}\"} else {print \"xxx.xx@test.com\"} %>",
"isAdvHtmlCss": true,
"fromfld": "AccessNow_DoNotReply@gmail.com",
"id": "Additional Email DNTL Employee's Manager for Gsuite",
"subjectfld": "xxxxxxG Suite",
"ccfld": null
}
}
============
Solved! Go to Solution.
03/15/2023 12:53 PM
What is the issue you are facing? if it is with to field then try below
<% if(user?.customproperty12.contains('50043222') || user?.customproperty12.contains('50043221')) print "${manager?.email}" else print \"xxx.xx@test.com\" %>
03/15/2023 08:52 PM
Hi SK,
it is throwing the below error,
Notification - GSuite / Avis d’accès aux systèmes de TELUS – G Suite
2023-03-15/09:27:42.512 [{}] [quartzScheduler_Worker-4] DEBUG services.ArsTaskService - Sending Email to - Additional Email DNTL Employee's Manager for Gsuite
2023-03-15/09:27:42.512 [{}] [quartzScheduler_Worker-4] DEBUG services.ArsTaskService - From Address AccessNow_DoNotReply@telus.com
2023-03-15/09:27:42.512 [{}] [quartzScheduler_Worker-4] DEBUG services.EmailerService - Called sendEmail without the MailConfig, finding the MailConfig
2023-03-15/09:27:42.515 [{}] [quartzScheduler_Worker-4] DEBUG services.EmailerService - Calling the sendEmail with the mailConfig - com.saviynt.ecm.utility.domain.EcmConfig : MAILCONFIG
2023-03-15/09:27:42.517 [{}] [quartzScheduler_Worker-4] DEBUG services.EmailerService - emailAuthType: Basic
2023-03-15/09:27:42.517 [{}] [quartzScheduler_Worker-4] DEBUG services.EmailerService - Called SendEmail with the mailConfig
2023-03-15/09:27:42.523 [{}] [quartzScheduler_Worker-4] DEBUG services.EmailerService - Setting TLS version -- TLSv1.2
2023-03-15/09:27:42.523 [{}] [quartzScheduler_Worker-4] DEBUG services.EmailerService - Properties is [mail.smtp.starttls.enable:true, mail.smtp.port:587, mail.debug:false, mail.smtp.ssl.trust:email-smtp.ca-central-1.amazonaws.com, mail.smtp.socketFactory.port:587, mail.smtp.auth:true, mail.smtp.starttls.required:true, mail.smtp.ssl.protocols:TLSv1.2]
2023-03-15/09:27:42.525 [{}] [quartzScheduler_Worker-4] DEBUG services.EmailerService - setting from address from email template: AccessNow_DoNotReply@telus.com
2023-03-15/09:27:42.525 [{}] [quartzScheduler_Worker-4] DEBUG services.EmailerService - Send to delegate flag = false
2023-03-15/09:27:42.525 [{}] [quartzScheduler_Worker-4] DEBUG services.EmailerService - Value of contentAsHtml true
2023-03-15/09:27:42.525 [{}] [quartzScheduler_Worker-4] DEBUG services.EmailerService - Setting content type as text/html
2023-03-15/09:27:42.525 [{}] [quartzScheduler_Worker-4] DEBUG println.PrintlnToLogger - Println :: jasperFilePath-/datadrive/sharedappdrivenfs/saviynt/reports
2023-03-15/09:27:42.526 [{}] [quartzScheduler_Worker-4] DEBUG println.PrintlnToLogger - Println :: [1;31m| Error [22;39mjava.lang.NullPointerException: Cannot get property 'address' on null object[m
2023-03-15/09:27:42.526 [{}] [quartzScheduler_Worker-4] DEBUG println.PrintlnToLogger - Println :: [1;31m| Error [22;39m at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:56)[m
2023-03-15/09:27:42.526 [{}] [quartzScheduler_Worker-4] DEBUG println.PrintlnToLogger - Println :: [1;31m| Error [22;39m at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:169)[m
03/16/2023 05:40 AM
Looks like it is resolving to null.. Does user has manager and that manager has email? if variable is wrong we see different error but in this case it is not getting the email for manager. so please validate the data you are testing
03/16/2023 06:37 AM
Hi Sk,
The manager has a valid email id, for testing purposes I have given my email id and my id as a manager of the user id.
Regards,
Manoj
03/16/2023 06:38 AM
03/16/2023 06:51 AM
Hi Rushikesh,
Thanks for your reply, let me try it out and then I would let you know the result.
Regards,
Manoj
04/16/2023 08:45 PM
There was no issue with the manager email, issue was with the email body itself where it was not able to print french character