Bcc notification configuration"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2024 05:57 AM
Hello everyone,
I am currently configuring a notification that is triggered by an event in my flow.
To send the notification, I need to set the "Event parm 2 contains recipient" option to true.
However, I don't want these emails to be sent as "To" but as "Bcc" instead.
What should I do?
Emai Script:
(function runMailScript(current, template, email, email_action, event) {
//email.clearAddress();
// Extrair informações do evento
var txt = event.parm1; // Assunto e conteúdo
var add = event.parm2; // Destinatários
txt = txt.toString().split('%%');
// Extrair nome e email
var displayName = add.substring(0, add.indexOf('<')).trim(); // Nome
var emailAddress = add.substring(add.indexOf('<') + 1, add.indexOf('>')).trim(); // Email
if (emailAddress != "") {
email.setFrom("");
email.addAddress('bcc', emailAddress, displayName); // Adiciona como BCC
}
email.setSubject(txt[0]);
template.print(txt[1]);
})(current, template, email, email_action, event);
The email is currently being sent:
Thank you in advance to anyone who can help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2024 09:20 AM - edited ‎10-14-2024 09:30 AM
Do you have some other users you want to send in TO? or you want to make TO to empty?
Try this if you want TO address to empty
You can uncheck 'Event parm 2 contains recipient' and use your logic.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP