brevo-node icon indicating copy to clipboard operation
brevo-node copied to clipboard

every email labled as "email is not valid in to"

Open arximughal opened this issue 1 year ago • 0 comments

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);
    }
  );

arximughal avatar Oct 21 '24 02:10 arximughal