mail_script why does it not populate the cc field?

andy_dufresne
Tera Expert

Hello Gurus,

I created the following mail-script and tested in Scripts Background it is returning emails for sure:

find_real_file.png

Now In my email template I'm invoking it like this:

find_real_file.png

But when I click on email, it does not populate the cc list, can you help me?

find_real_file.png

Thanks in advance

1 ACCEPTED SOLUTION

Thanks to all who responded.   I finally solved it and this is how:



Firstly the email.addAddress thingy did not work, *but* what was working is if I put a field name say 'description' in 'to' field it would populate the value from description in the mail-template. So ..



  1. I created a new column say 'u_emailAddressHolder'
  2. Created a insert/update business rule that will update email addresses into this column based on my query
  3. Updated my template 'To' field with simply 'u_emailAddressHolder'


bingo all emails pop up.



I must give credit to Mr.David Hreben, who actually used this ingenious trick in the last message in here 🙂 Email Client  


View solution in original post

10 REPLIES 10

Chuck Tomasi
Tera Patron

The mail script doesn't go in the To or Cc fields. It goes in the message body and is run when the message is sent (you won't see the result in the email client template.)



Scripting for email notifications


If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.



If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.



Thank you


Thanks Chuck,



I tried putting this in the message_body too, but still no result.


find_real_file.png



Nothing came up when I clicked the email button


find_real_file.png



this script does return the values so I'm pretty sure its not empty:



find_real_file.png


The mail script is run after you hit send. It isn't going to dynamically populate the values on the form. It's not a matter of whether it is running, but WHEN it is running. Have you tried a sample message and observed what is being placed in the outbox (and then sent)?