sendgrid / sendgrid-nodejs

The Official Twilio SendGrid Led, Community Driven Node.js API Library
https://sendgrid.com
MIT License
3k stars 782 forks source link

Change `Promise.all` to `Promise.allSettle` for ease of error handling #1409

Open satasuk03 opened 3 months ago

satasuk03 commented 3 months ago

https://github.com/sendgrid/sendgrid-nodejs/blob/07b4f7108b76c7e6617c74526aea15fbf7f9af3d/packages/mail/src/classes/mail-service.js#L165

In this case, if we send 100 mails at a time, but if a single mail is failed, all pending mails will be stopped. In the other hand, it should send as much as possible and return the send result to the user (cb signature also need to be updated)