Skip to content

🐛 [firestore-send-email] asm.group_id support in sendgrid #2849

@Bradley-McCallion

Description

@Bradley-McCallion

[READ] Step 1: Are you in the right place?

Issues filed here should be about a feature request for a specific extension in this repository. To file a feature request that affects multiple extensions or the Firebase Extensions platform, please reach out to
Firebase support directly.

[REQUIRED] Step 2: Extension name

firestore-send-email

What feature would you like to see?

Add support for passing SendGrid's asm object to the SendGrid API, specifically asm.group_id and optionally asm.groups_to_display.

Currently, the sendGrid field in the Firestore document only exposes templateId, dynamicTemplateData, mailSettings, customArgs, ipPoolName, and categories. There is no way to pass asm through — the Zod validation schema strips unknown keys and the field mapping in index.ts only picks known properties explicitly.

The feature would require:

  • Adding asm to sendGridSchema in validation.ts
  • Adding asm to the ExtendedSendMailOptions interface in types.ts
  • Mapping payload.sendGrid?.asm in index.ts
  • Adding asm to MailSource / SendGridMessage in nodemailer-sendgrid/types.ts and handling it in the transport

How would you use it?

When sending transactional emails via SendGrid dynamic templates, we need to associate each email with a SendGrid unsubscribe group so that recipients can manage their preferences and one-click unsubscribe links work correctly. This is required for CAN-SPAM / GDPR compliance in many production setups.

The Firestore document would look like:

{
    "to": ["user@example.com"],
    "sendGrid": {
      "templateId": "d-xxxxxxxxxxxx",
      "dynamicTemplateData": { "name": "Jane" },
      "asm": {
        "group_id": 12345,
        "groups_to_display": [12345, 67890]
      }
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions