Skip to content

feat(smtp): add contactPixelTrackingConsent to transactional email recipients - #144

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 transactional email recipients#144
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 optional per-recipient contactPixelTrackingConsent boolean to the to, cc and bcc items of POST /v3/smtp/email, and to the same three recipient lists nested inside messageVersions:

  • SendTransacEmailRequestToItem / CcItem / BccItem
  • SendTransacEmailRequestMessageVersionsItemToItem / CcItem / BccItem

Each is a typed nullable property with a #[JsonProperty] attribute, alphabetically ordered, plus the constructor array-shape docblock entry and ?? null default — mirroring the Fern PHP generator output exactly.

Verified

  • phpstan (level max, 996 files) and phpunit (75 tests) green both before and after
  • php -l clean on all six edited files
  • Tri-state proven on the wire: true"contactPixelTrackingConsent":true, falsefalse, and omitted (or PHP null) → key absent, because JsonSerializableType::jsonSerialize() drops null properties never marked explicitly set
  • 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

Add the optional per-recipient `contactPixelTrackingConsent` boolean to the
`to`, `cc` and `bcc` items of `POST /v3/smtp/email`, and to the same three
recipient lists nested inside `messageVersions`:

- SendTransacEmailRequestToItem
- SendTransacEmailRequestCcItem
- SendTransacEmailRequestBccItem
- SendTransacEmailRequestMessageVersionsItemToItem
- SendTransacEmailRequestMessageVersionsItemCcItem
- SendTransacEmailRequestMessageVersionsItemBccItem

The field is live in production and already present in the OpenAPI spec, but
this SDK has not been regenerated since 2026-07-03, so it was missing. This is
a hand-written stopgap that mirrors the Fern PHP generator output exactly
(typed nullable property + `#[JsonProperty]` attribute, alphabetically ordered,
constructor array-shape docblock entry, `?? null` default). Field descriptions
are copied verbatim from the spec.

NOTE: this repository is Fern-generated. The next `fern generate` will
overwrite these files — that is expected and fine, since the regenerated
output will contain the same field. No version bump: Fern owns versioning.

Tri-state semantics verified end to end against the wire bytes:
`true` -> `"contactPixelTrackingConsent":true`, `false` -> `false`, and when
the key is omitted (or passed as PHP `null`) it is absent from the payload,
because JsonSerializableType::jsonSerialize() drops null properties that were
never marked explicitly set.

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>
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

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