
Memicu Email

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 no-cost 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 konsolMenggunakan Firebase CLI
Anda juga dapat menggunakan Firebase CLI untuk menginstal dan mengelola ekstensi:
Langkah 1: Jalankan perintah npm berikut untuk menginstal CLI atau mengupdate ke versi CLI terbaru.
npm install -g firebase-toolsTidak berhasil? Lihat referensi Firebase CLI atau ubah izin npm Anda.
Langkah 2: Siapkan direktori project Firebase baru atau buka direktori yang sudah ada
Langkah 3: Tambahkan ekstensi ini ke manifes ekstensi Anda dengan menjalankan
firebase ext:install firebase/firestore-send-email --local --project=projectId_or_alias
Step 4 (Optional): Test this extension locally with the Firebase Emulator Suite
firebase emulators:start
Langkah 5: Deploy ekstensi dalam manifes ke project Anda
firebase deploy --only extensions --project=projectId_or_alias