MailScript - send BCC email not working

Felipe Morais
Tera Contributor

Hello guys,

I need to send an email notification via BCC. I tried using the following mail script to do so, but it's not working:
FelipeMorais_0-1702563913193.png


I used gs.log for debug, but i don't get any message in the System Logs, apparently it does not even call the script from the notification template.

This is my notification, where i call the mail script

FelipeMorais_1-1702564327934.png


The condition to send is when a record is inserted in the "HR case" table.

And for the "who will receive" i used my email as a test (and the email is sent to me, so the notification is working,), what's not working is the mail script.

Does anybody have an idea why the mail script is not working as supposed?

Thanks in advance!

FLM

17 REPLIES 17

Yes, because you dont have a recipient, you need to trigger the notification with an event from a script, in a for each, and pass the recipient to let's say parm1 and check in the who will receive Event parm 1 contains recipient.

StefanGeorgiev_0-1702567694421.png

 

that way you are going to send the notification to as many times as many users there are in the bcc.


Your script should look something like this:

var bccMembers = ['test1@test.com','test2@test.com','test3@test.com'] // i think here were mails not sys_ids you can test both ways,

bccMembers .forEach(function(member){

gs.eventQueue(<"your event">, current, member)

})

 

Hope that this helps you!

If the provided information answers your question, please consider marking it as Helpful and Accepting the Solution so other community users can find it faster.

All the Best,
Stefan

But i have a recipient, it's myself, i put my email in the "user" field for "who will receive"

Do you have the Send to event creator checked ?

StefanGeorgiev_0-1702568536422.png

 

Yes i have

Hi @Felipe Morais,
do you have your notifications allowed and the instance notifications allowed to send notifications?

 

StefanGeorgiev_0-1702636619450.png

 

StefanGeorgiev_1-1702636677559.png

if the instance is non production you should add your mail in -

Send all email to this test email address (non-production testing)

 

Hope that this helps you!

If the provided information answers your question, please consider marking it as Helpful and Accepting the Solution so other community users can find it faster.

All the Best,
Stefan