mailjet / mailjet-apiv3-nodejs

[API v3] Official Mailjet API v3 NodeJS wrapper
https://dev.mailjet.com
MIT License
236 stars 69 forks source link

3.1.0 is including breaking changes without error and is a beta endpoint?! #31

Closed Jolg42 closed 7 years ago

Jolg42 commented 7 years ago

Hi,

I'm really disappointed with the changes in the API, you did breaking changes without telling anybody.

The problem here is that I'm using "To" & "Bcc" old format SMTP style and it's not throwing an error when I use it with the latest v3.1.0 of node-mailjet. I only had people complaining that they didn't receive emails but that was weird for me as the "Bcc" email was sent to me successfully.

I just figured out the problem when I opened the API Guides and found that https://dev.mailjet.com/beta/#send-api-v3-to-v3-1

To, Cc, Bcc The SMTP style description of the recipients is replaced by a collection of recipients objects (with Email and Name property), nested in array.

Also the 3.1 is marked as BETA here, this is really confusing, you shouldn't use a BETA endpoint as people are using this library in production and without any notice!

Also the tests are too light for this library, only "Recipients" is tested and not "To" & "Bcc" (See https://dev.mailjet.com/guides/#sending-a-basic-email)

Please do better tests and throw an error if the "To" & "Bcc" are not correct instead of just sending half of the emails...

Jolg42 commented 7 years ago

Also doing the change with

"To": [{"Name": "Someone","Email": "johndoe@gmail.com"}] "Bcc": [{"Name": "SomeoneElse","Email": "johndoe2@gmail.com"}]

Is returning a 400 Bad Request without any description of the error? BETA Effect? If it's because of the BETA you should remove the BETA endpoint from that library asap!

arnaudbreton commented 7 years ago

Hi @Jolg42, sorry you're having a bad experience with our Node wrapper / API.

Just to clear out what may have confused you: this v3.1.0 release of the wrapper is a pure coincidence with Send API v3.1 currently under beta. The wrapper is now compatible with both version (v3 and v3.1), leveraging the optional options object and version key which can be passed to the wrapper constructor.

I've just tested it myself and I still manage to send emails using v3 as described at https://dev.mailjet.com/guides/?javascript#sending-a-basic-email

Can you please show us more sample codes and show us how do you instantiate the wrapper?

Again, apologies for the troubles. Hope we'll get this sorted very soon!

Jolg42 commented 7 years ago

Hi @arnaudbreton,

I see...!

So I just did some tests again, and it looks like I don't receive the email when it's sent to my personal email address "@gmail.com" (I checked everywhere including spam folder) as "To" but always receive the "Bcc" email on my pro email address. That was confusing...

Could you check if my personal email address is not blacklisted for some reason? Because when I send it to another email address it works :(

arnaudbreton commented 7 years ago

Sure thing. For privacy reason, please open a support ticket at https://app.mailjet.com/support/ticket and give me back its number so I can follow up there.

Jolg42 commented 7 years ago

Thank you for the fast support :) Here it is: N° 681767

arnaudbreton commented 7 years ago

Got it, let's pursue there.