Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple unsubscribe request is failing address validation #203

Closed
nwkeeley opened this issue Apr 30, 2018 · 3 comments
Closed

Multiple unsubscribe request is failing address validation #203

nwkeeley opened this issue Apr 30, 2018 · 3 comments

Comments

@nwkeeley
Copy link

nwkeeley commented Apr 30, 2018

Mailgun-js: 0.17.0
Node.js 8.5 mac osx

This Does not work

const mailgun = require('mailgun-js')({ apiKey: MyKey, domain: MyDomain }); 

const data = [
  { address: 'foo@example.com' },
  { address: 'foo2@example.com' }
];

mailgun.post(`/${MyDomain}/unsubscribes`, data, (error, body) => {
  // Fails with error "Error: Missing mandatory parameter: address"
});

This does work

const mailgun = require('mailgun-js')({ apiKey: MyKey, domain: MyDomain }); 

const data = { address: 'foo@example.com' };

mailgun.post(`/${MyDomain}/unsubscribes`, data, (error, body) => {
  // works
});
@nwkeeley
Copy link
Author

Documentation says to pass a content-type of application/json for multiple requests - but I don't see where / how to pass that header in the current api call

@bojand bojand closed this as completed in f2db0e4 May 1, 2018
@bojand
Copy link
Collaborator

bojand commented May 1, 2018

Hello, this should be addressed in 0.18.0.

@nwkeeley
Copy link
Author

nwkeeley commented May 1, 2018

Thats great thank you for the quick turn around @bojand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants