MailScript - send BCC email not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 06:35 AM - edited 12-14-2023 07:40 AM
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:
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 07:33 AM
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.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 07:38 AM
But i have a recipient, it's myself, i put my email in the "user" field for "who will receive"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2023 07:42 AM
Do you have the Send to event creator checked ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 01:56 AM
Yes i have
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 02:39 AM
Hi @Felipe Morais,
do you have your notifications allowed and the instance notifications allowed to send notifications?
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