You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm testing out the sdk but I'm getting the following error:
FetchError: invalid json response body at https://api.mailersend.com/v1/email reason: Unexpected end of JSON input
at /Users/cruzyv/repos/personal-artist-backend/node_modules/node-fetch/lib/index.js:273:32
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
type: 'invalid-json'
}
const emailParams = new EmailParams()
.setFrom('hello@XXX')
.setFromName('test')
.setRecipients(recipients)
.setReplyTo('reply@XXX')
.setReplyToName('Reply to name')
.setSubject('Hello there.')
.setHtml('This is the HTML content')
.setText('This is the text content');
Hello, I'm testing out the sdk but I'm getting the following error:
FetchError: invalid json response body at https://api.mailersend.com/v1/email reason: Unexpected end of JSON input
at /Users/cruzyv/repos/personal-artist-backend/node_modules/node-fetch/lib/index.js:273:32
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
type: 'invalid-json'
}
This is my code
`
const Recipient = require('mailersend').Recipient;
const EmailParams = require('mailersend').EmailParams;
const MailerSend = require('mailersend');
const mailersend = new MailerSend({
api_key: process.env.MAILERSEND_API_KEY,
});
const recipients = [new Recipient('XXXX', 'Andrés')];
const emailParams = new EmailParams()
.setFrom('hello@XXX')
.setFromName('test')
.setRecipients(recipients)
.setReplyTo('reply@XXX')
.setReplyToName('Reply to name')
.setSubject('Hello there.')
.setHtml('This is the HTML content')
.setText('This is the text content');
mailersend
.send(emailParams)
.then((response) => {
return response.json();
})
.catch((error) => {
console.log(error);
});`
I've got a dependency that has me pin down to node 16... could that be it ?
The text was updated successfully, but these errors were encountered: