Skip to content

feat(smtp): add contactPixelTrackingConsent to sendTransacEmail recipients - #95

Open
piyush-sib wants to merge 1 commit into
getbrevo:mainfrom
piyush-sib:feat/smtp-email-contact-pixel-tracking-consent
Open

feat(smtp): add contactPixelTrackingConsent to sendTransacEmail recipients#95
piyush-sib wants to merge 1 commit into
getbrevo:mainfrom
piyush-sib:feat/smtp-email-contact-pixel-tracking-consent

Conversation

@piyush-sib

@piyush-sib piyush-sib commented Aug 5, 2026

Copy link
Copy Markdown

Adds the per-recipient contactPixelTrackingConsent boolean to all six inlined recipient shapes of POST /v3/smtp/email in SendTransacEmailRequest.ts:

  • SendTransacEmailRequest.To.Item / .Cc.Item / .Bcc.Item
  • SendTransacEmailRequest.MessageVersions.Item.To.Item / .Cc.Item / .Bcc.Item

This is a typing-only change

There is no src/serialization layer for this endpoint and Client.ts does body: request straight to core.fetcher, so the field already reaches the wire on published 6.0.2 for untyped JS callers. Only TypeScript users were blocked — they could not set it without an as any cast. Nothing about the request payload changes.

Verified

  • pnpm build (tsc cjs + esm) clean; vitest run 57 files / 1431 tests passed, unchanged vs. baseline
  • biome format:check + lint clean on the edited file
  • tsc --strict snippet setting the field on to/cc/bcc and inside messageVersions with no casts compiles; "banana" is a type error
  • local capture server: true / false land per recipient, key entirely absent (not null, not false) when omitted — tri-state survives
  • real sends to api.brevo.com/v3 on prod test account 3143293: 201, delivered

Why this is hand-written

This repo is Fern-generated and has not been regenerated since 2026-07-03, so the field never appeared in the published SDK even though the spec has carried it for weeks. Rather than keep waiting on a fern generate run, this is a hand-written stopgap that matches what the generator would emit. The next fern generate will overwrite these files — that is expected and fine, because the regenerated output contains the same field. No version bump: Fern owns versioning.

Six edits, not four: Fern inlines separate recipient copies for messageVersions, matching the 6 occurrences in the spec.

Description wording covers clicks too

Per-contact consent gates click links as well as the open pixel — an=1 is stamped at send time by DTSL/sendmail-personaliser#1231 and consumed by DTSL/redirection#2384, in production since 2026-08-03. The descriptions here reflect that. The matching spec wording update is DTSL/public-api#5895 (legacy client spec + OpenAPI bundle + generated v3, all in one PR). Until it merges this text is ahead of the published spec.

Related

🤖 Generated with Claude Code

…ients

Add the per-recipient `contactPixelTrackingConsent` boolean to all six
inlined recipient shapes of POST /v3/smtp/email:

  - SendTransacEmailRequest.To.Item / .Cc.Item / .Bcc.Item
  - SendTransacEmailRequest.MessageVersions.Item.To.Item / .Cc.Item / .Bcc.Item

The field is already live in prod and present in the OpenAPI spec
(fern/brevo-open.yml in public-developer-portal), but brevo-node has not
been regenerated since 2026-07-03, so the property was missing from the
published types. Descriptions are copied verbatim from the spec (the cc
and bcc variants have their own wording).

This is a compile-time-only change. There is no src/serialization layer
for this endpoint and Client.ts passes `body: request` straight to
core.fetcher, so the field already reached the wire at runtime; callers
simply could not set it without an `as any` cast. Nothing about the
request payload changes.

This is a hand-written stopgap, matching what was already done for
brevo-java, brevo-csharp, brevo-ruby and brevo-go. The next
`fern generate` will overwrite this file - that is expected and fine,
because the regenerated output will contain the same field (the spec
has it). The package version is intentionally left alone; Fern owns
versioning.

Verified with:
  - pnpm build (tsc cjs + esm): clean
  - vitest run: 57 files / 1431 tests passed (no change vs. baseline)
  - biome format:check + lint on the edited file: clean
  - typecheck snippet setting the field on to/cc/bcc and inside
    messageVersions with no casts: compiles; `"banana"` is a type error
  - local capture server on :18201: `true` / `false` land per recipient
    and the key is entirely absent (not null, not false) when omitted
  - 2 real sends to api.brevo.com/v3 (prod test account 3143293): 201

The description text covers both open (pixel) and click tracking: per-contact
consent gates click links as well, via an=1 stamped at send time by
sendmail-personaliser #1231 and consumed by redirection #2384 (in production
since 2026-08-03). The matching public-api spec wording update is still
pending, so these descriptions are currently ahead of the published spec text.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant