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

Confusion on how to add attachments to transactional emails #7

Open
jumpsplat120 opened this issue Jul 17, 2023 · 3 comments
Open

Confusion on how to add attachments to transactional emails #7

jumpsplat120 opened this issue Jul 17, 2023 · 3 comments

Comments

@jumpsplat120
Copy link

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?

@sergomet
Copy link

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

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

@jcfausto
Copy link

jcfausto commented Nov 5, 2024

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.

@niklashaa
Copy link

Had the same issue,
Brevo provides documentation here and here

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

4 participants