diff --git a/OnedriveApp.js b/OnedriveApp.js index 32e2857..2ef941f 100644 --- a/OnedriveApp.js +++ b/OnedriveApp.js @@ -758,6 +758,9 @@ function getCode(e) { createEmailBody = function(e) { var remain, temp; + e.to = e.to.filter(function(f) { + return f && typeof f === "object"; + }); temp = { message: { subject: e.subject, @@ -787,6 +790,9 @@ function getCode(e) { delete e.htmlBody; } if (e.cc && Array.isArray(e.cc)) { + e.cc = e.cc.filter(function(f) { + return f && typeof f === "object"; + }); temp.message.ccRecipients = e.cc.map(function(f) { return { emailAddress: { @@ -798,6 +804,9 @@ function getCode(e) { delete e.cc; } if (e.bcc && Array.isArray(e.bcc)) { + e.bcc = e.bcc.filter(function(f) { + return f && typeof f === "object"; + }); temp.message.bccRecipients = e.bcc.map(function(f) { return { emailAddress: { diff --git a/README.md b/README.md index 351bcbf..b31efa8 100644 --- a/README.md +++ b/README.md @@ -560,6 +560,10 @@ If you have any questions and commissions for me, feel free to tell me. A bug of "Send Email messages" was removed. +- v1.2.2 (July 27, 2023) + + Checked the array of `to`, `cc`, and `bcc` for the sendEmails method. + # Performance test - November 20, 2022: No errors and no issues occur.