Reputation: 1608
I have been working with the sendgrid email API ("Mail Send") and I am trying to keep track of the mails that have been sent, so i can watch when they have been clicked or responded to. When I send a mail, I get a 202, but the response body is empty (not undefined or anything) According to the docs I am supposed to get a schema back. Am I missing some critical piece of information. I am testing with Ngrok
email.send({ to: '[email protected]',
from: '[email protected]',
subject: 'Hello world',
text: 'Hello plain world!'
}).then(([response, body]) => {
console.log('::::8', body) // EMPTY
console.log(response.statusCode);
console.log('::::4', response)
}) .catch(error => {
console.error('::::5', error.response?.body);
});
Upvotes: 1
Views: 1096
Reputation: 61
According to the docs you only get a response from the api call when there's an error. For a successful email send (with a 202 code) you shouldn't get any response.
Upvotes: 2