email not triggering to the user.

abhisek
Tera Contributor
(function runMailScript(current, template, email, email_action, event) {
   
    var selectedValue = current.variables.partner.toString();

    gs.info('Selected Value: ' + selectedValue);

   
    email.send(null, selectedValue);
})(current, template, email, email_action, event);
 
The above is my email script. Here partner is a select box variable where label is user's name and text is user's email id. In the notification I have attached the email script by ${mail_script:requirement_fulfill} and in the notification 'who will receive' tab I have selected Assignment group for the field 'Users/Groups in fields' and a specific user for the the field 'Users'.
The assignment group and that specific user is getting the notification but the user whom I am sending notification using the above email script is not receiving the notification but in system log getting that user's email id.
 
I had test it with different active users from the partner select box variable values whose email id is available, and notification is enabled but these users are not getting notification. Email properties are also fine.
 
Can anyone please help me out ASAP as it is very urgent.
 
1 ACCEPTED SOLUTION

Jim Coyne
Kilo Patron

Where did you find the "email.send()" function?

 

You'll want to take a look at this page: Example scripting for email notifications

 

I have not tried it, but something like this should work:

 

(function runMailScript(current, template, email, email_action, event) {
  var email = current.variables.partner.toString();  //get the email address
  var name = current.variables.partner.getDisplayValue();  //get the name of the person
  email.addAddress("cc", email, name);  //add the address to the Email
})(current, template, email, email_action, event);

 

 

View solution in original post

2 REPLIES 2

Jim Coyne
Kilo Patron

Where did you find the "email.send()" function?

 

You'll want to take a look at this page: Example scripting for email notifications

 

I have not tried it, but something like this should work:

 

(function runMailScript(current, template, email, email_action, event) {
  var email = current.variables.partner.toString();  //get the email address
  var name = current.variables.partner.getDisplayValue();  //get the name of the person
  email.addAddress("cc", email, name);  //add the address to the Email
})(current, template, email, email_action, event);

 

 

Hi @Jim Coyne 

Thanks a lot for your time and reply. It is working absolutely fine. 😊