orliesaurus / nodemailer-mailgun-transport

nodemailer is an amazing node module to send emails within any of your nodejs apps. This is the transport plugin that goes with nodemailer to send email using Mailgun 🔫
MIT License
882 stars 98 forks source link

Not allow array on 'to' field? #56

Closed siygle closed 7 years ago

siygle commented 7 years ago

It ok to pass an array as receiver (e.g., to: ['a@abc.com', 'b@abc.com']) if we want to send to multiple receivers at once. However, after upgrade to v1.3 it seems not work anymore and will show following error messages.

{ Error: 'to' parameter is not a valid address. please check documentation
    at IncomingMessage.<anonymous> (/Users/sylee/PositiveGrid/internal-modules/pg-mailer/node_modules/nodemailer-mailgun-transport/node_modules/mailgun-js/lib/request.js:309:15)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9) statusCode: 400 } { message: '\'to\' parameter is not a valid address. please check documentation' }

It's ok when I tried downgrade to v1.2.x

orliesaurus commented 7 years ago

Hey @Ferrari can you test the below and let me know if it works?

 to: [{name:'Mary', address:'mary@differentexample.com'}, {address:'john@anotherexample.com'}]
orliesaurus commented 7 years ago

also cc'in @ADumaine

siygle commented 7 years ago

@orliesaurus object parameter works fine, only array will return error.

siygle commented 7 years ago

Any plan publish a new version include this patch?

orliesaurus commented 7 years ago

Very soon

orliesaurus commented 7 years ago

Donezo @Ferrari Thank you for your patience