killmenot / nodemailer-postmark-transport

Postmark transport for Nodemailer
MIT License
32 stars 12 forks source link

fix(parser): prune out null addresses in bulk #18

Closed shanestillwell closed 3 years ago

shanestillwell commented 3 years ago

If there is a null address in an address array, Postmark rejects the email.

For example, this will fail

const addresses = [null, 'shane@northernv.com'];
killmenot commented 3 years ago

Hi,

From my point of view, this should not be done inside the lib. Let me explain why.

When we pass some incorrect data to API, API should return some error message that explains what is wrong. Here we have 2 addresses (valid and invalid) where we try to send email but only one email is delivered. So, it looks like it works correctly but in the same time we don't know about the problems with data, we just ignore it. I believe it should be handled on application level

shanestillwell commented 3 years ago

Fair enough. That's what I'm doing now.

I submitted this because I ran into this with my app, but was getting an undefined reason for it being rejected. I'm still trying to figure out why the promise rejection is undefined when an address is null.