Google berkomitmen untuk mendorong terwujudnya keadilan ras bagi komunitas Kulit Hitam. Lihat caranya.

Memicu Email

Firebase
Made by Firebase

Membuat dan mengirim email berdasarkan konten dokumen yang ditulis ke koleksi Cloud Firestore tertentu.

Cara kerja ekstensi ini

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.

Cara menginstal ekstensi ini

Menggunakan Firebase console

Anda dapat menggunakan Firebase console untuk menginstal dan mengelola ekstensi.

Instal menggunakan konsol

Menggunakan Firebase CLI

Anda juga dapat menggunakan Firebase CLI untuk menginstal dan mengelola ekstensi:

Langkah 1: Jalankan perintah npm berikut untuk menginstal CLI atau memperbarui ke versi CLI terbaru.

npm install -g firebase-tools
Tidak berhasil? Lihat referensi Firebase CLI atau ubah izin npm Anda.

Langkah 2: Instal ekstensi ini dengan menjalankan perintah berikut

firebase ext:install firestore-send-email --project=projectId_or_alias
Dukungan
Cloud Firestore
Penulis
Lisensi
Apache-2.0
Versi
0.1.6