I'm using send grid to send and receive emails. Currently I'm facing an issue that is: It is creating a new email thread after every inbound reply on the existing thread. It is not preserving all the subsequent messages in the same thread. Any Idea? Anyone have access to send grid updated documentations ?
Please find my code below:
sgMail.setApiKey(apiKey);
const msg = {
to: lead.email,
from: config.email,
subject: subject,
html: body,
attachments: attachments
};
console.log('sendGrid', msg);
return new Promise((resolve, reject) => {
sgMail
.send(msg)
.then(() => {
console.log('Email sent');
resolve('Email sent');
}).catch((error) => {
console.log('error sendGrid', error.response.body);
reject(error);
});
});