Skip to content

Commit 1fdaca1

Browse files
Ehesplaurenzlong
authored andcommitted
feat(firestore-send-email) Attach headers to nodemailer (#108)
1 parent 5c7413c commit 1fdaca1

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

firestore-send-email/POSTINSTALL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The top-level fields of the document supply the email sender and recipient infor
4747
* **ccUids:** An array containing the CC recipient UIDs.
4848
* **bcc:** A single recipient email address or an array containing multiple recipient email addresses.
4949
* **bccUids:** An array containing the BCC recipient UIDs.
50+
* **headers:** An object of additional header fields (for example, `{"X-Custom-Header": "value", "X-Second-Custom-Header": "value"}`).
5051
5152
**NOTE:** The `toUids`, `ccUids`, and `bccUids` options deliver emails based on user UIDs keyed to email addresses within a Cloud Firestore document. To use these recipient options, you need to specify a Cloud Firestore collection for the extension's "Users collection" parameter. The extension can then read the `email` field for each UID specified in the `toUids`, `ccUids`, and/or `bccUids` fields.
5253

firestore-send-email/functions/lib/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ function deliver(payload, ref) {
198198
to: payload.to,
199199
cc: payload.cc,
200200
bcc: payload.bcc,
201+
headers: payload.headers || {},
201202
}));
202203
const info = {
203204
messageId: result.messageId || null,

firestore-send-email/functions/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ interface QueuePayload {
7373
bccUids?: string[];
7474
from?: string;
7575
replyTo?: string;
76+
headers?: any;
7677
}
7778

7879
function validateFieldArray(field: string, array?: string[]) {
@@ -262,6 +263,7 @@ async function deliver(
262263
to: payload.to,
263264
cc: payload.cc,
264265
bcc: payload.bcc,
266+
headers: payload.headers || {},
265267
})
266268
);
267269
const info = {

0 commit comments

Comments
 (0)