[firestore-send-email] Unable to send base64 encoded attachment
See original GitHub issue[READ] Step 1: Are you in the right place?
Issues filed here should be about bugs for a specific extension in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:
- For general technical questions, post a question on StackOverflow with the firebase tag.
- For general Firebase discussion, use the firebase-talk google group.
- To file a bug against the Firebase Extensions platform, or for an issue affecting multiple extensions, please reach out to Firebase support directly.
[REQUIRED] Step 2: Describe your configuration
// ? send the email notification
return await db.collection('mail').add({
to:email,
template: {
name: 'template',
data: {
...
},
attachments: [
{
filename: `Invoice-${invoice.invoice_number}.pdf`,
content: pdf.toString('base64'),
encoding: 'base64',
contentType: 'application/pdf'
}
]
}
})
- Extension name:
firestore-send-email
- Extension version:
0.1.17
- Configuration values (redact info where appropriate):
DEFAULT_FROM=support@_.com
DEFAULT_REPLY_TO=support@_.com
LOCATION=us-central1
MAIL_COLLECTION=mail
SMTP_CONNECTION_URI=smtps://email_address@smtp.gmail.com:465
SMTP_PASSWORD=password
TEMPLATES_COLLECTION=mail_templates
USERS_COLLECTION=users
[REQUIRED] Step 3: Describe the problem
The extension does not process a base64 encoded attachment. The email is successfully send, however, the email does not have a file attachment.
Steps to reproduce:
Create a record in the mail
collection
Expected result
The email should have a PDF attachment.
Actual result
There is no attachment in the received email.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Firebase email trigger extension: can't attach pdf file
I'm trying to send the pdf as text (or encoded text) and not upload the file to some storage and then just send...
Read more >Upload files with Cloud Storage on Web - Firebase
If a Blob , File , or Uint8Array isn't available, you can use the uploadString() method to upload a raw, base64 , base64url...
Read more >Upload base64 string to Firebase Storage - Google Groups
I am trying to create a Google function that will accept base64 string and save to the Firebase Storage. I've tried two versions,...
Read more >Base64 Encoding | Cloud Vision API - Google Cloud
You can provide image data to the Vision API by specifying the URI path to the image, or by sending the image data...
Read more >Why is base64 needed (aka why can't I just email a binary file)?
MIME message parts can have "Content-Transfer-Encoding: 8bit", indicating that they are not encoded in any way. However, the SMTP protocol ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@atanaskanchev I think I understand, does this example meet your requirements?
@dackers86 this works perfectly, thanks for your help!