|
8 | 8 |
|
9 | 9 | **CONFIGURATION PARAMETERS:**
|
10 | 10 |
|
11 |
| -* Deployment location: *Where should the extension be deployed? For help selecting a location, refer to the [location selection guide](https://firebase.google.com/docs/functions/locations).* |
| 11 | +* Deployment location: Where should the extension be deployed? For help selecting a location, refer to the [location selection guide](https://firebase.google.com/docs/functions/locations). |
12 | 12 |
|
13 |
| -* SMTP connection URI: *A URI representing an SMTP server that this extension can use to deliver email.* |
| 13 | +* SMTP connection URI: A URI representing an SMTP server that this extension can use to deliver email. |
14 | 14 |
|
15 |
| -* Email documents collection: *What is the path to the collection that contains the documents used to build and send the emails?* |
| 15 | +* Email documents collection: What is the path to the collection that contains the documents used to build and send the emails? |
16 | 16 |
|
17 |
| -* Default FROM address: *The email address to use as the sender's address (if it's not specified in the added email document).* |
| 17 | +* Default FROM address: The email address to use as the sender's address (if it's not specified in the added email document). |
18 | 18 |
|
19 |
| -* Default REPLY-TO address: *The email address to use as the reply-to address (if it's not specified in the added email document).* |
| 19 | +* Default REPLY-TO address: The email address to use as the reply-to address (if it's not specified in the added email document). |
20 | 20 |
|
21 |
| -* Users collection: *A collection of documents keyed by user UID. If the `toUids`, `ccUids`, and/or `bccUids` recipient options are used in the added email document, this extension delivers email to the `email` field based on lookups in this collection.* |
| 21 | +* Users collection: A collection of documents keyed by user UID. If the `toUids`, `ccUids`, and/or `bccUids` recipient options are used in the added email document, this extension delivers email to the `email` field based on lookups in this collection. |
22 | 22 |
|
23 |
| -* Templates collection: *A collection of email templates keyed by name. This extension can render an email using a [Handlebar](https://handlebarsjs.com/) template, if the template is specified in the added email document.* |
| 23 | +* Templates collection: A collection of email templates keyed by name. This extension can render an email using a [Handlebar](https://handlebarsjs.com/) template, if the template is specified in the added email document. |
24 | 24 |
|
25 | 25 |
|
26 | 26 |
|
27 |
| -**NON-CLOUD FUNCTION RESOURCES CREATED**: |
| 27 | +**CLOUD FUNCTIONS CREATED:** |
28 | 28 |
|
29 |
| -* processQueue (firebaseextensions.v1beta.function) |
| 29 | +* processQueue (providers/cloud.firestore/eventTypes/document.write) |
30 | 30 |
|
31 | 31 |
|
32 | 32 |
|
33 |
| -**DETAILS**: Use this extension to render and send emails that contain the information from documents added to Cloud Firestore. |
| 33 | +**DETAILS**: Use this extension to render and send emails that contain the information from documents added to a specified Cloud Firestore collection. |
34 | 34 |
|
35 | 35 | 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)
|
36 | 36 |
|
37 |
| -Here's a basic example documment write that would trigger this extension: |
| 37 | +Here's a basic example document write that would trigger this extension: |
38 | 38 |
|
39 | 39 | ```js
|
40 | 40 | admin.firestore().collection('mail').add({
|
41 |
| - to: ['someone@example.com'], |
| 41 | + to: 'someone@example.com', |
42 | 42 | message: {
|
43 | 43 | subject: 'Hello from Firebase!',
|
44 | 44 | html: 'This is an <code>HTML</code> email body.',
|
45 | 45 | },
|
46 | 46 | })
|
47 | 47 | ```
|
48 | 48 |
|
49 |
| -Because each email is built from a Cloud Firestore document, you can reference information stored in _other_ Cloud Firestore documents and fields, like image URLs. |
50 |
| - |
51 | 49 | You can also optionally configure this extension to render emails using [Handlebar](https://handlebarsjs.com/) templates. Each template is a document stored in a Cloud Firestore collection.
|
52 | 50 |
|
53 |
| -When you configure this extension, you'll need to supply your **SMTP credentials for mail delivery** and specify the Cloud Firestore collection where you'll add documents. If you want to use templates, you'll also need to specify the collection containing your template documents. |
| 51 | +When you configure this extension, you'll need to supply your **SMTP credentials for mail delivery**. |
54 | 52 |
|
55 |
| -### Billing |
| 53 | +#### Additional setup |
56 | 54 |
|
57 |
| -This extension uses other Firebase or Google Cloud Platform services which may have associated charges: |
| 55 | +Before installing this extension, make sure that you've [set up a Cloud Firestore database](https://firebase.google.com/docs/firestore/quickstart) in your Firebase project. |
58 | 56 |
|
| 57 | +#### Billing |
| 58 | + |
| 59 | +This extension uses other Firebase or Google Cloud Platform services which may have associated charges: |
59 | 60 | - Cloud Firestore
|
60 | 61 | - Cloud Functions
|
61 | 62 |
|
|
0 commit comments