Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SendSmtpEMail constructor not getting sender #9

Open
loyos opened this issue Sep 3, 2023 · 2 comments
Open

SendSmtpEMail constructor not getting sender #9

loyos opened this issue Sep 3, 2023 · 2 comments

Comments

@loyos
Copy link

loyos commented Sep 3, 2023

I tried it just as showed in the guide and got this error --> { code: 'missing_parameter', message: 'sender is missing' },

Here an extract of the code snippet

var sendSmtpEmail = new Brevo.SendSmtpEmail({
    subject: 'Hello from the Node SDK!',
    sender: { email: '[email protected]', name: 'Sendinblue' },
    replyTo: { email: '[email protected]', name: 'Sendinblue' },
    to: [{ name: 'John Doe', email: '[email protected]' }],
    htmlContent:
        '<html><body><h1>This is a transactional email {{params.bodyMessage}}</h1></body></html>',
    params: { bodyMessage: 'Made just for you!' },
}); // SendSmtpEmail | Values to send a transactional email
@VincentJouanne
Copy link

I am also experiencing the same issue

@JefferyHus
Copy link

I think they expect a sender id? from their documentation

curl --request POST \
     --url https://api.brevo.com/v3/smtp/email \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "sender": {
    "name": "Mary from MyShop",
    "email": "[email protected]",
    "id": 2
  },
  "to": [
    {
      "email": "[email protected]",
      "name": "Jimmy"
    }
  ],
  "bcc": [
    {
      "email": "[email protected]",
      "name": "Helen"
    }
  ],
  "cc": [
    {
      "email": "[email protected]",
      "name": "Ann"
    }
  ],
  "htmlContent": "<!DOCTYPE html> <html> <body> <h1>Confirm you email</h1> <p>Please confirm your email address by clicking on the link below</p> </body> </html>",
  "textContent": "Please confirm your email address by clicking on the link https://text.domain.com",
  "subject": "Login Email confirmation",
  "replyTo": {
    "email": "[email protected]",
    "name": "Ann"
  },
  "attachment": [
    {
      "url": "https://attachment.domain.com/myAttachmentFromUrl.jpg",
      "content": "b3JkZXIucGRm",
      "name": "myAttachment.png"
    }
  ],
  "headers": {
    "sender.ip": "1.2.3.4",
    "X-Mailin-custom": "some_custom_header",
    "idempotencyKey": "abc-123"
  },
  "templateId": 2,
  "params": {
    "FNAME": "Joe",
    "LNAME": "Doe"
  },
  "messageVersions": [
    {
      "to": [
        {
          "email": "[email protected]",
          "name": "Jimmy"
        }
      ],
      "params": {
        "FNAME": "Joe",
        "LNAME": "Doe"
      },
      "bcc": [
        {
          "email": "[email protected]",
          "name": "Helen"
        }
      ],
      "cc": [
        {
          "email": "[email protected]",
          "name": "Ann"
        }
      ],
      "replyTo": {
        "email": "[email protected]",
        "name": "Ann"
      },
      "subject": "Login Email confirmation"
    }
  ],
  "tags": [
    "tag1"
  ],
  "scheduledAt": "2022-04-05T12:30:00+02:00",
  "batchId": "5c6cfa04-eed9-42c2-8b5c-6d470d978e9d"
}

While the part related to Node.js shows no id property used in the sender object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants