
Acionar e-mails
Made by Firebase
Cria e envia um e-mail com base no conteúdo de um documento gravado em uma coleção especificada do Cloud Firestore.
Como esta extensão funciona
Use this extension to render and send emails that contain the information from documents added to a specified Cloud Firestore collection.
Adding a document triggers this extension to send an email built from the document's fields. The document's top-level fields specify the email sender and recipients, including to
, cc
, and bcc
options (each supporting UIDs). The document's message
field specifies the other email elements, like subject line and email body (either plaintext or HTML)
Here's a basic example document write that would trigger this extension:
admin.firestore().collection('mail').add({ to: 'someone@example.com', message: { subject: 'Hello from Firebase!', html: 'This is an <code>HTML</code> email body.', }, })
You can also optionally configure this extension to render emails using Handlebar templates. Each template is a document stored in a Cloud Firestore collection.
When you configure this extension, you'll need to supply your SMTP credentials for mail delivery. Note that this extension is for use with bulk email service providers, like SendGrid, Mailgun, etc.
Additional setup
Before installing this extension, make sure that you've set up a Cloud Firestore database in your Firebase project.
Billing
To install an extension, your project must be on the Blaze (pay as you go) plan
- You will be charged a small amount (typically around $0.01/month) for the Firebase resources required by this extension (even if it is not used).
- This extension uses other Firebase and Google Cloud Platform services, which have associated charges if you exceed the service’s free tier:
- Cloud Firestore
- Cloud Functions (Node.js 10+ runtime. See FAQs)
Usage of this extension also requires you to have SMTP credentials for mail delivery. You are responsible for any associated costs with your usage of your SMTP provider.
Como instalar a extensão
Como usar o Console do Firebase
Para instalar e gerenciar extensões, use o Console do Firebase.
Instalar usando o consoleComo usar a Firebase CLI
Para instalar e gerenciar extensões, também é possível usar a Firebase CLI:
Etapa 1: execute o comando npm (em inglês) a seguir para instalar a CLI ou atualizá-la para a versão mais recente.
npm install -g firebase-toolsNão está funcionando? Consulte a referência da Firebase CLI ou altere suas permissões do npm (em inglês).
Etapa 2: execute o comando a seguir para instalar a extensão.
firebase ext:install firestore-send-email --project=projectId_or_alias