From 5b61f2e52295417d38f0508b5395210f0698cf8f Mon Sep 17 00:00:00 2001 From: Piyush Singh Date: Thu, 30 Jul 2026 12:49:20 +0530 Subject: [PATCH] feat(smtp): add contactPixelTrackingConsent to sendTransacEmail recipients 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) --- .../client/requests/SendTransacEmailRequest.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/api/resources/transactionalEmails/client/requests/SendTransacEmailRequest.ts b/src/api/resources/transactionalEmails/client/requests/SendTransacEmailRequest.ts index 2cbac68..8437f54 100644 --- a/src/api/resources/transactionalEmails/client/requests/SendTransacEmailRequest.ts +++ b/src/api/resources/transactionalEmails/client/requests/SendTransacEmailRequest.ts @@ -86,6 +86,8 @@ export namespace SendTransacEmailRequest { export namespace Bcc { export interface Item { + /** Consent of the recipient in bcc for open (pixel) and click tracking, resolved by the sender at send time. Considered only if the per-contact pixel tracking consent feature is enabled for your account. Pass `true` if this recipient has consented to open and click tracking, in which case the open pixel and tracked links identify the recipient. Pass `false` to anonymise the open and click events (counted in aggregate statistics only). If it is not passed, the recipient is treated as unknown consent status and the email is still sent (the open and click are anonymised unless your account tracks unknown-consent contacts). A value other than `true`/`false` is rejected. Ignored when the feature is not enabled for your account. */ + contactPixelTrackingConsent?: boolean | undefined; /** BCC recipient email address */ email: string; /** Display name of the BCC recipient. Maximum length is 70 characters. */ @@ -97,6 +99,8 @@ export namespace SendTransacEmailRequest { export namespace Cc { export interface Item { + /** Consent of the recipient in cc for open (pixel) and click tracking, resolved by the sender at send time. Considered only if the per-contact pixel tracking consent feature is enabled for your account. Pass `true` if this recipient has consented to open and click tracking, in which case the open pixel and tracked links identify the recipient. Pass `false` to anonymise the open and click events (counted in aggregate statistics only). If it is not passed, the recipient is treated as unknown consent status and the email is still sent (the open and click are anonymised unless your account tracks unknown-consent contacts). A value other than `true`/`false` is rejected. Ignored when the feature is not enabled for your account. */ + contactPixelTrackingConsent?: boolean | undefined; /** CC recipient email address */ email: string; /** Display name of the CC recipient. Maximum length is 70 characters. */ @@ -131,6 +135,8 @@ export namespace SendTransacEmailRequest { export namespace Bcc { export interface Item { + /** Consent of the recipient in bcc for open (pixel) and click tracking, resolved by the sender at send time. Considered only if the per-contact pixel tracking consent feature is enabled for your account. Pass `true` if this recipient has consented to open and click tracking, in which case the open pixel and tracked links identify the recipient. Pass `false` to anonymise the open and click events (counted in aggregate statistics only). If it is not passed, the recipient is treated as unknown consent status and the email is still sent (the open and click are anonymised unless your account tracks unknown-consent contacts). A value other than `true`/`false` is rejected. Ignored when the feature is not enabled for your account. */ + contactPixelTrackingConsent?: boolean | undefined; /** BCC recipient email address */ email: string; /** Display name of the BCC recipient. Maximum length is 70 characters. */ @@ -142,6 +148,8 @@ export namespace SendTransacEmailRequest { export namespace Cc { export interface Item { + /** Consent of the recipient in cc for open (pixel) and click tracking, resolved by the sender at send time. Considered only if the per-contact pixel tracking consent feature is enabled for your account. Pass `true` if this recipient has consented to open and click tracking, in which case the open pixel and tracked links identify the recipient. Pass `false` to anonymise the open and click events (counted in aggregate statistics only). If it is not passed, the recipient is treated as unknown consent status and the email is still sent (the open and click are anonymised unless your account tracks unknown-consent contacts). A value other than `true`/`false` is rejected. Ignored when the feature is not enabled for your account. */ + contactPixelTrackingConsent?: boolean | undefined; /** CC recipient email address */ email: string; /** Display name of the CC recipient. Maximum length is 70 characters. */ @@ -163,6 +171,8 @@ export namespace SendTransacEmailRequest { export namespace To { export interface Item { + /** Consent of the recipient for open (pixel) and click tracking, resolved by the sender at send time. Considered only if the per-contact pixel tracking consent feature is enabled for your account. Pass `true` if this recipient has consented to open and click tracking, in which case the open pixel and tracked links identify the recipient. Pass `false` to anonymise the open and click events (counted in aggregate statistics only). If it is not passed, the recipient is treated as unknown consent status and the email is still sent (the open and click are anonymised unless your account tracks unknown-consent contacts). A value other than `true`/`false` is rejected. Ignored when the feature is not enabled for your account. */ + contactPixelTrackingConsent?: boolean | undefined; /** Email address of the recipient */ email: string; /** Display name of the recipient. Maximum length is 70 characters. */ @@ -198,6 +208,8 @@ export namespace SendTransacEmailRequest { export namespace To { export interface Item { + /** Consent of the recipient for open (pixel) and click tracking, resolved by the sender at send time. Considered only if the per-contact pixel tracking consent feature is enabled for your account. Pass `true` if this recipient has consented to open and click tracking, in which case the open pixel and tracked links identify the recipient. Pass `false` to anonymise the open and click events (counted in aggregate statistics only). If it is not passed, the recipient is treated as unknown consent status and the email is still sent (the open and click are anonymised unless your account tracks unknown-consent contacts). A value other than `true`/`false` is rejected. Ignored when the feature is not enabled for your account. */ + contactPixelTrackingConsent?: boolean | undefined; /** Email address of the recipient */ email: string; /** Display name of the recipient. Maximum length is 70 characters. */