I added the trigger email extension to my firebase project and it works well. I am now trying to send an email with an attachment from firebase storage. I tried adding the access token of the file to the content field of the message and the email is sent with the corresponding file (in this case a pdf file) but when I try to open it, it is corrupted. Am I doing something wrong or is it just not possible to attach files from storage?
Is it possible to attach a file from firebase storage to an email using the trigger email extension?
Asked
Active
Viewed 134 times
1 Answers
0
it is possible to send an attachment with this extension.
Could you provide an example of how you are adding this attachment? For example:
- A link to a file source
- Base 64 included content
A link to a file would look like
attachments: [
{
content: "invoice",
filename: "{{invoice_link}}",
},
],
Base 64 content would be similar to:
attachments: [
{ content: "dGhpcyBpcyBhIHRlc3Q=" // base64 string
encoding: "base64"
filename "ImportantDocument.pdf"
}
]

Darren Ackers
- 148
- 1
- 6
-
Thanks for the reply. I ended up just writing a trigger function and used nodemailer there. – Amit Goft Jan 25 '23 at 10:34