brevo-node
brevo-node copied to clipboard
every email labled as "email is not valid in to"
I'm trying to configure this library to send out transactional emails. I have a template up in the account as well. But every single email that I try to send out, gives the same error (EVEN WITH DIFFERENT EMAIL ADDRESSES):
body: { code: 'invalid_parameter', message: 'email is not valid in to' },
Here's a snippet of the code:
sendSmtpEmail.to = [{ email: message.to }];
sendSmtpEmail.params = message.params;
sendSmtpEmail.templateId = message.templateId;
sendSmtpEmail.replyTo = { email: '[email protected]', name: 'Example' };
apiInstance.sendTransacEmail(sendSmtpEmail).then(
(data) => {
console.log(
`API called successfully. Returned data: ${JSON.stringify(data)}`
);
},
(error) => {
console.error(error);
}
);