이메일 트리거

Firebase
Made by Firebase

지정된 Cloud Firestore 컬렉션에 기록된 문서의 콘텐츠를 사용해 이메일을 작성하고 전송합니다.

이 확장 프로그램의 작동 방식

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.

확장 프로그램 설치 방법

Firebase Console 사용

Firebase Console을 사용해 확장 프로그램을 설치하고 관리할 수 있습니다.

Console을 사용해 설치하기

Firebase CLI 사용

Firebase CLI를 사용해 확장 프로그램을 설치하고 관리할 수도 있습니다.

1단계: 다음 npm 명령어를 실행하여 CLI를 설치하거나 최신 CLI 버전으로 업데이트합니다.

npm install -g firebase-tools
작동하지 않는 경우 Firebase CLI 참조를 살펴보거나 npm 권한을 변경하세요.

2단계: 다음 명령어를 실행하여 이 확장 프로그램을 설치합니다.

firebase ext:install firestore-send-email --project=projectId_or_alias
지원
Cloud Firestore
작성자
라이선스
Apache-2.0
버전
0.1.6