Closed aorsten closed 5 years ago
I was able to solve it, after reading #62 . I needed to write the parameters for the email as:
const sendSmtpEmail = new SibApiV3Sdk.SendSmtpEmail();
sendSmtpEmail.to = [{email: 'my@domain.com'}];
sendSmtpEmail.templateId = 1;
sendSmtpEmail.params = {
...
};
I completely second the sentiment in #62 , as I struggled for a long while before accidentally reading #62.
This issue shouldn't be closed... The apidocs are misleading...
This is not written in any part of the documentation, it would be helpful to update the docs.
yes same error here. should be re-open i have been searching for hours because of this.
Information is different depending on wich doc you look at -->
https://developers.sendinblue.com/reference#smtp-1 not the same as here https://developers.sendinblue.com/docs/send-a-transactional-email
To be fare i tried as @aorsten aorsten mentioned and still got the error
Unfortunately this is still an issue when using the new client @getbrevo/brevo
and the code snippet described here: https://developers.brevo.com/recipes/send-transactional-emails-in-nodejs
I got the mentioned error "Sender is missing" by passing the email parameters into the constructor directly, and to solve it had to assign them afterwards like this:
const sendSmtpEmail = new Brevo.SendSmtpEmail();
Object.keys(emailDetails || {}).map(key => {
sendSmtpEmail[key] = emailDetails[key];
});
Unfortunately this is still an issue when using the new client
@getbrevo/brevo
and the code snippet described here: https://developers.brevo.com/recipes/send-transactional-emails-in-nodejsI got the mentioned error "Sender is missing" by passing the email parameters into the constructor directly, and to solve it had to assign them afterwards like this:
const sendSmtpEmail = new Brevo.SendSmtpEmail();
Object.keys(emailDetails || {}).map(key => {
sendSmtpEmail[key] = emailDetails[key];
});
Thank you @vincenzodomina this is exactly what I needed
I'm trying to send a transactional email based on a template. My template ID is # 1, and I am able to view the template by using:
However, when trying to send using sendTransacEmail, I get an error:
{"code":"missing_parameter","message":"sender is missing"}
. Here is the code:This gives the error:
According to the API, I think using a templateId means that a sender does not need to be set. I have even tried to explicitly set a sender, but I still get the same error message.
Is this an error with the node package, the API, with my sendinblue setup, or something else?