aheckmann / node-ses

An Amazon SES api for nodejs with proper error handling.
http://aheckmann.github.com/node-ses
MIT License
200 stars 37 forks source link

More flexible validation #11

Closed Cellule closed 9 years ago

Cellule commented 9 years ago

SES doesn't need the to field, it needs at least one of to cc or bcc. see http://docs.aws.amazon.com/ses/latest/APIReference/API_SendEmail.html and http://docs.aws.amazon.com/ses/latest/APIReference/API_Destination.html

markstos commented 9 years ago

It's surprising that 'to' is not required, but I don't see it as a formal requirement in RFC 2822, either.

Could you update the README as well to note which fields are required, and then I'll plan to merge this. Also, add a note in History.md as well. Basically, make it easy to put out the next release and I'll get it done.

Thanks!

mathieumg commented 9 years ago

Moreover, I imagine this test would need to be updated: https://github.com/aheckmann/node-ses/blob/master/test/index.js#L259

markstos commented 9 years ago

Yes, I expect tests to be passing in the updated PR as well.

Cellule commented 9 years ago

Hi, I am in my finals at the moment, I will get on this as soon as I get some me time.

Cellule commented 9 years ago

The test

 Email #send should callback an error:
     Uncaught AssertionError: false == true
      at C:\Mike\node-ses\test\index.js:345:9
      at Request._callback (C:\Mike\node-ses\lib\ses.js:286:14)
      at Request.self.callback (C:\Mike\node-ses\node_modules\request\main.js:119:22)
      at Request.<anonymous> (C:\Mike\node-ses\node_modules\request\main.js:525:16)
      at Request.emit (events.js:95:17)
      at IncomingMessage.<anonymous> (C:\Mike\node-ses\node_modules\request\main.js:484:14)
      at IncomingMessage.emit (events.js:117:20)
      at _stream_readable.js:943:16
      at process._tickCallback (node.js:419:13)

still fails, but I do have an error, just not the one expected. I think it has to do with arguments passed to the tests. I have the error The security token included in the request is invalid when we're expecting node-ses failed with status: 403 and data:

markstos commented 9 years ago

Thanks. Getting released today.