Populate email client template recipients dynamically based on the reference field clicked

Syed30
Tera Expert

Hi,

I am trying to create multiple email client templates and then pickup one of them dynamically based on certain criteria when the compose email popup is opened.

 

Background:

I have added icons to the reference fields on my form and whenever of the icon is clicked I want to pass the selected user as the recipient to my template. 

 

For this I have initially created two email client templates and tried to passed the sys id of the email template to the popupOpenEmailClient() function. The issue is that it always picks up the oldest and only one template and not the other one.

 

I have also tried to add the notification email script to the template but the problem is that the object "email" is not available inside the email client template script hence I am not able to set the recipient via email.addAddress() function inside email script.

 

Is it possible to achieve what I am trying to do? if not is there any other possible way to achieve it? - Basically I want the email client recipients to be populated from the Reference field icon that user clicked on the form.

 

Thanks

 

1 REPLY 1

acjunior
Tera Contributor

Did you find any solution?
i'm facing the same problem