Skip to content

πŸ› [firestore-send-email] Custom SendGrid transport silently drops API fields (custom_args, ip_pool_name, etc.)Β #2670

@michalpechnet

Description

@michalpechnet

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

Yes β€” this is a bug in the firestore-send-email extension.

[REQUIRED] Step 2: Describe your configuration

  • Extension name: firestore-send-email
  • Extension version: 0.2.5
  • Configuration values:
    • SMTP host: smtp.sendgrid.net (SendGrid provider)

[REQUIRED] Step 3: Describe the problem

Hey! We recently upgraded to version 0.2.5 from an older version and noticed that some SendGrid features we relied on stopped working silently.

In our previous setup, we were using the X-SMTPAPI header (SendGrid v2 SMTP API) to pass unique_args and ip_pool:

{
  "to": "recipient@example.com",
  "message": { "subject": "Test", "text": "Hello" },
  "headers": {
    "X-SMTPAPI": "{\"unique_args\": {\"campaign\": \"welcome\"}, \"ip_pool\": \"transactional\"}"
  }
}

This used to work great because the extension sent emails via SMTP, where SendGrid picks up the X-SMTPAPI header automatically.

Version 0.2.5 now uses a custom SendGridTransport that calls the @sendgrid/mail v3 Web API directly instead of SMTP. The X-SMTPAPI header is no longer picked up. The v3 equivalents (customArgs, ipPoolName, etc.) would need to be passed as dedicated fields in the API payload, but the transport only forwards a hardcoded list of fields and quietly ignores the rest.

The tricky part is that there's no error or warning β€” emails go out fine, they just lose the extra SendGrid features. Also there is no note in the CHANGELOG about the SMTP-to-Web-API migration.

Steps to reproduce:

  1. Upgrade to version 0.2.5 from an older version that used SendGrid over SMTP
  2. Send an email with X-SMTPAPI header containing unique_args / ip_pool
  3. Check SendGrid Activity Feed or webhook events β€” unique_args are missing and IP pool selection is ignored
  4. Try using the v3 equivalents via sendGrid.customArgs / sendGrid.ipPoolName β€” these are also silently dropped

Expected result:

  • The v3 API equivalents (customArgs, ipPoolName, sendAt, batchId, asm, trackingSettings) are supported as fields in the sendGrid document property

Actual result:

  • X-SMTPAPI header is silently ignored
  • v3 API fields like customArgs and ipPoolName are not forwarded to the SendGrid API
  • No error or warning β€” emails send successfully but without the expected SendGrid features

We've already put together a fix for customArgs and ipPoolName and would be happy to open a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions