From 3ffe3dcc26ac87e77c06eef8ebf9b3fd3f49b673 Mon Sep 17 00:00:00 2001 From: Jacob Cable Date: Fri, 11 Jul 2025 20:15:44 +0100 Subject: [PATCH 1/2] Revert "fix(firestore-send-email) restore headers support (#2463)" This reverts commit f7fd9232f8d9ac843960169d59bef956ccf17f55. --- firestore-send-email/CHANGELOG.md | 4 ---- firestore-send-email/PREINSTALL.md | 23 --------------------- firestore-send-email/README.md | 23 --------------------- firestore-send-email/functions/src/index.ts | 1 - 4 files changed, 51 deletions(-) diff --git a/firestore-send-email/CHANGELOG.md b/firestore-send-email/CHANGELOG.md index d70db6e19..5ae1416af 100644 --- a/firestore-send-email/CHANGELOG.md +++ b/firestore-send-email/CHANGELOG.md @@ -1,9 +1,5 @@ ## Version 0.2.4 -fix: add missing 'headers' field to the mailOptions interface - -docs: update documentation to include 'headers' field - fix: TTL expire type "week" fixed (#2455) ## Version 0.2.3 diff --git a/firestore-send-email/PREINSTALL.md b/firestore-send-email/PREINSTALL.md index 30ab98009..db67bafb1 100644 --- a/firestore-send-email/PREINSTALL.md +++ b/firestore-send-email/PREINSTALL.md @@ -18,29 +18,6 @@ You can also optionally configure this extension to render emails using [Handleb 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. -#### Using custom headers - -You can add custom headers to your emails by including a `headers` field in the document you add to the Firestore collection. The `headers` field should be an object where each key is the header name and the value is the header value. - -## Example JSON with Custom Headers: -```json -{ - "to": ["example@example.com"], - "message": { - "subject": "Test Email with Custom Headers", - "text": "This is a test email to see if custom headers work.", - "html": "This is a test email to see if custom headers work." - }, - "headers": { - "X-Custom-Header": "CustomValue", - "X-Another-Header": "AnotherValue", - } -} -``` - -Add this document to the Firestore mail collection to send an email with custom headers. -You can even include headers like 'List-Unsubscribe' to allow recipients to unsubscribe from your emails. - #### Firestore-Send-Email: SendGrid Categories When using SendGrid (`SMTP_CONNECTION_URI` includes `sendgrid.net`), you can assign categories to your emails. diff --git a/firestore-send-email/README.md b/firestore-send-email/README.md index 8db815d18..b12c67c37 100644 --- a/firestore-send-email/README.md +++ b/firestore-send-email/README.md @@ -26,29 +26,6 @@ You can also optionally configure this extension to render emails using [Handleb 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. -#### Using custom headers - -You can add custom headers to your emails by including a `headers` field in the document you add to the Firestore collection. The `headers` field should be an object where each key is the header name and the value is the header value. - -## Example JSON with Custom Headers: -```json -{ - "to": ["example@example.com"], - "message": { - "subject": "Test Email with Custom Headers", - "text": "This is a test email to see if custom headers work.", - "html": "This is a test email to see if custom headers work." - }, - "headers": { - "X-Custom-Header": "CustomValue", - "X-Another-Header": "AnotherValue", - } -} -``` - -Add this document to the Firestore mail collection to send an email with custom headers. -You can even include headers like 'List-Unsubscribe' to allow recipients to unsubscribe from your emails. - #### Firestore-Send-Email: SendGrid Categories When using SendGrid (`SMTP_CONNECTION_URI` includes `sendgrid.net`), you can assign categories to your emails. diff --git a/firestore-send-email/functions/src/index.ts b/firestore-send-email/functions/src/index.ts index 1611a051e..8346e6f57 100644 --- a/firestore-send-email/functions/src/index.ts +++ b/firestore-send-email/functions/src/index.ts @@ -173,7 +173,6 @@ async function deliver(ref: DocumentReference): Promise { subject: payload.message?.subject, text: payload.message?.text, html: payload.message?.html, - headers: payload?.headers, attachments: payload.message?.attachments, categories: payload.categories, templateId: payload.sendGrid?.templateId, From 8822be0fdff90af95feecf303509aaf118e90224 Mon Sep 17 00:00:00 2001 From: Juan Rodriguez Date: Fri, 11 Jul 2025 20:18:51 +0100 Subject: [PATCH 2/2] fix(firestore-send-email) restore headers support (#2463) Originally contributed by Juan Rodriguez (Nushio) but incorrectly attributed during merge. Re-applying with proper attribution. --- firestore-send-email/CHANGELOG.md | 4 ++++ firestore-send-email/PREINSTALL.md | 23 +++++++++++++++++++++ firestore-send-email/README.md | 23 +++++++++++++++++++++ firestore-send-email/functions/src/index.ts | 1 + 4 files changed, 51 insertions(+) diff --git a/firestore-send-email/CHANGELOG.md b/firestore-send-email/CHANGELOG.md index 5ae1416af..b68182c0f 100644 --- a/firestore-send-email/CHANGELOG.md +++ b/firestore-send-email/CHANGELOG.md @@ -1,5 +1,9 @@ ## Version 0.2.4 +fix: add missing 'headers' field to the mailOptions interface (contributed by @Nushio) + +docs: update documentation to include 'headers' field (contributed by @Nushio) + fix: TTL expire type "week" fixed (#2455) ## Version 0.2.3 diff --git a/firestore-send-email/PREINSTALL.md b/firestore-send-email/PREINSTALL.md index db67bafb1..30ab98009 100644 --- a/firestore-send-email/PREINSTALL.md +++ b/firestore-send-email/PREINSTALL.md @@ -18,6 +18,29 @@ You can also optionally configure this extension to render emails using [Handleb 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. +#### Using custom headers + +You can add custom headers to your emails by including a `headers` field in the document you add to the Firestore collection. The `headers` field should be an object where each key is the header name and the value is the header value. + +## Example JSON with Custom Headers: +```json +{ + "to": ["example@example.com"], + "message": { + "subject": "Test Email with Custom Headers", + "text": "This is a test email to see if custom headers work.", + "html": "This is a test email to see if custom headers work." + }, + "headers": { + "X-Custom-Header": "CustomValue", + "X-Another-Header": "AnotherValue", + } +} +``` + +Add this document to the Firestore mail collection to send an email with custom headers. +You can even include headers like 'List-Unsubscribe' to allow recipients to unsubscribe from your emails. + #### Firestore-Send-Email: SendGrid Categories When using SendGrid (`SMTP_CONNECTION_URI` includes `sendgrid.net`), you can assign categories to your emails. diff --git a/firestore-send-email/README.md b/firestore-send-email/README.md index b12c67c37..8db815d18 100644 --- a/firestore-send-email/README.md +++ b/firestore-send-email/README.md @@ -26,6 +26,29 @@ You can also optionally configure this extension to render emails using [Handleb 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. +#### Using custom headers + +You can add custom headers to your emails by including a `headers` field in the document you add to the Firestore collection. The `headers` field should be an object where each key is the header name and the value is the header value. + +## Example JSON with Custom Headers: +```json +{ + "to": ["example@example.com"], + "message": { + "subject": "Test Email with Custom Headers", + "text": "This is a test email to see if custom headers work.", + "html": "This is a test email to see if custom headers work." + }, + "headers": { + "X-Custom-Header": "CustomValue", + "X-Another-Header": "AnotherValue", + } +} +``` + +Add this document to the Firestore mail collection to send an email with custom headers. +You can even include headers like 'List-Unsubscribe' to allow recipients to unsubscribe from your emails. + #### Firestore-Send-Email: SendGrid Categories When using SendGrid (`SMTP_CONNECTION_URI` includes `sendgrid.net`), you can assign categories to your emails. diff --git a/firestore-send-email/functions/src/index.ts b/firestore-send-email/functions/src/index.ts index 8346e6f57..1611a051e 100644 --- a/firestore-send-email/functions/src/index.ts +++ b/firestore-send-email/functions/src/index.ts @@ -173,6 +173,7 @@ async function deliver(ref: DocumentReference): Promise { subject: payload.message?.subject, text: payload.message?.text, html: payload.message?.html, + headers: payload?.headers, attachments: payload.message?.attachments, categories: payload.categories, templateId: payload.sendGrid?.templateId,