SuiteScript Example – Sending Email to Multiple Recipients

What good is an email you can only send to one person? How else would you catch people accidentally hitting “Reply All”? The N/email.send() method supports multiple recipients as well as CC and BCC functionality:

results in an email with a list of recipients:

Multiple recipients

The recipients property supports a single internal ID or a single email address string to send to one person, or an Array of those to send to multiple people. Here we have an Array containing two email addresses, thus our to line on the email will have these two recipient addresses.

CC and BCC

The send() method also provides the cc and bcc options to provide the corresponding functionality. These two properties behave identically to the recipients property in that they accept a single ID or address as well as an Array containing either or both.

cc: [17, “frodo@fly.fool”] will CC both frodo@fly.fool as well as the Entity record with internal ID 17.

Similarly, bcc: [“s@iseeyou.mordor”, 21, “notthegrey@eaglefriends.mid”] will BCC three different email addresses: s@iseeyou.mordor, notthegrey@eaglefriends.mid, and the Entity record with internal ID 21.

Recipient Limit

Note that the send() method is limited to a maximum of 10 recipients across all of recipients, cc, and bcc.

If you need to send emails to larger audiences, such as with Marketing Campaigns, there are other methods within N/email for that purpose. Researching them on your own is a useful exercise.

HTH

-EG

This is a complete chapter from the Sending Email with SuiteScript Cookbook.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Related posts

January 7, 2021

Anything I wrote today about business would both feel and be inadequate. I simply can’t arrive at the words to express how I feel in this moment. So instead, here are a few helpful ...

Read More

December 20, 2020

2020 was a hundred swift kicks to the shorts and one giant kick in the ass. If you’ve lost people you love, if you’ve gotten sick or hurt, if you’ve lost your job, if ...

Read More

December 16, 2020

“I’ve been meaning to learn SuiteScript, but it’s hard to find the time …”“We’re slammed, and I just don’t have the time …”“I haven’t made the time …” All are variations of a theme ...

Read More

December 14, 2020

Last week we looked at mimicking the functionality of a REST endpoint with its own module (e.g. retrieving a User, or a list of Users, refreshing a token, etc). For complex integrations that rely on a large ...

Read More