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

Confusion on how to add attachments to transactional emails

Open jumpsplat120 opened this issue 2 years ago • 3 comments

I'm currently trying to attach a pdf to a transactional email. Looking at the docs, it says that it takes a Base64 encoded chunk data of the attachment generated on the fly, but the actual type is a Blob. I've actually tried both a Blob and a base64 string, but while the email does send, it doesn't have the attachments.

What's the correct way to add an attachment?

jumpsplat120 avatar Jul 17 '23 22:07 jumpsplat120

This is an old question, but perhaps it will help others.

... 
attachments = [
  {
     content: "here is the base64",
     name: "some filename"
  }
]
... 

sergomet avatar Oct 21 '24 10:10 sergomet

I had a similar issue.

I was following the docs here

Screenshot 2024-11-05 at 12 06 56

In my understanding, I should send an array of SendSmtpEmailAttachment objects, but it does not work when done this way.

The only way it worked was passing the hash as @sergomet suggested directly to the mail.attachment array. It worked this way.

jcfausto avatar Nov 05 '24 11:11 jcfausto

Had the same issue, Brevo provides documentation here and here

niklashaa avatar Dec 18 '24 15:12 niklashaa