-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextension.yaml
More file actions
111 lines (97 loc) · 3.44 KB
/
extension.yaml
File metadata and controls
111 lines (97 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: mailtrap-email
version: 1.0.1
specVersion: v1beta
displayName: Send Email with Mailtrap
description: >-
Sends emails via Mailtrap API when documents are created in a
specified Cloud Firestore collection. Supports templates, attachments,
and delivery status tracking.
license: Apache-2.0
icon: icon.png
author:
authorName: Mailtrap
url: https://mailtrap.io
sourceUrl: https://github.com/mailtrap/mailtrap-firebase
releaseNotesUrl: https://github.com/mailtrap/mailtrap-firebase/blob/main/CHANGELOG.md
billingRequired: true
roles:
- role: datastore.user
reason: Allows this extension to read and update email documents in Firestore.
resources:
- name: processQueue
type: firebaseextensions.v1beta.v2function
description: >-
Processes document writes in the specified Cloud Firestore collection,
delivers emails via Mailtrap, and updates documents with delivery status.
properties:
location: ${FUNCTION_LOCATION}
buildConfig:
runtime: nodejs22
serviceConfig:
timeoutSeconds: 60
availableMemory: 256Mi
eventTrigger:
eventType: google.cloud.firestore.document.v1.created
triggerRegion: ${DATABASE_LOCATION}
eventFilters:
- attribute: database
value: (default)
- attribute: document
value: ${param:MAIL_COLLECTION}/{documentId}
operator: match-path-pattern
params:
- param: FUNCTION_LOCATION
label: Cloud Functions location
description: >-
Where do you want to deploy the functions created for this extension?
For help selecting a location, refer to the
[location selection guide](https://firebase.google.com/docs/functions/locations).
type: string
default: us-central1
required: true
immutable: true
- param: DATABASE_LOCATION
label: Firestore database location
description: >-
Where is your Firestore database located? The event trigger must be
in the same region as the database. For multi-region US use `nam5`,
for multi-region EU use `eur3`. Refer to the
[Firestore locations guide](https://firebase.google.com/docs/firestore/locations).
type: string
default: nam5
required: true
immutable: true
- param: MAILTRAP_API_TOKEN
label: Mailtrap API Token
description: >-
Your Mailtrap API token for sending emails.
Get it from https://docs.mailtrap.io/email-api-smtp/setup/api-tokens
type: secret
required: true
- param: MAIL_COLLECTION
label: Email documents collection
description: >-
Path to the Firestore collection where email documents will be written.
type: string
default: mail
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
validationErrorMessage: Must be a valid Cloud Firestore collection path.
required: true
- param: DEFAULT_FROM_EMAIL
label: Default FROM email address
description: >-
Default sender email address used when not specified in the document.
Use an address from a verified sending domain.
See https://docs.mailtrap.io/email-api-smtp/setup/sending-domain
type: string
example: noreply@example.com
validationRegex: "^.+@.+\\..+$"
validationErrorMessage: Must be a valid email address.
required: true
- param: DEFAULT_FROM_NAME
label: Default FROM name
description: >-
Default sender name used when not specified in the document (optional).
type: string
example: My App
required: false