From c7e3629c15e4ea8e017dbe46cbcfc9bcbfd326ce Mon Sep 17 00:00:00 2001 From: Piyush Singh Date: Thu, 30 Jul 2026 12:52:23 +0530 Subject: [PATCH] feat(smtp): add contactPixelTrackingConsent to transactional email recipients MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the per-recipient `contactPixelTrackingConsent` boolean to the `to`, `cc` and `bcc` item models of `POST /v3/smtp/email`, and to the same three recipient collections nested inside `messageVersions`: - SendTransacEmailRequestToItem - SendTransacEmailRequestCcItem - SendTransacEmailRequestBccItem - SendTransacEmailRequestMessageVersionsItemToItem - SendTransacEmailRequestMessageVersionsItemCcItem - SendTransacEmailRequestMessageVersionsItemBccItem The field is `typing.Optional[bool]` exposed as the snake_case attribute `contact_pixel_tracking_consent` with the camelCase wire alias `contactPixelTrackingConsent`, declared with `FieldMetadata` + `pydantic.Field(alias=..., description=...)` exactly as the generator emits aliased optional properties. Descriptions are copied verbatim from the OpenAPI spec. Tri-state semantics are preserved: `True`/`False` are sent as `true`/`false`, and the key is omitted entirely when unset. This is a hand-written stopgap: the repo is Fern-generated and the next `fern generate` will overwrite these files. That is expected and fine — the field is already in the OpenAPI spec, so the regenerated output will contain it anyway. Package version is intentionally not bumped; Fern owns versioning. 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) --- .../types/send_transac_email_request_bcc_item.py | 10 ++++++++++ .../types/send_transac_email_request_cc_item.py | 10 ++++++++++ ...sac_email_request_message_versions_item_bcc_item.py | 10 ++++++++++ ...nsac_email_request_message_versions_item_cc_item.py | 10 ++++++++++ ...nsac_email_request_message_versions_item_to_item.py | 10 ++++++++++ .../types/send_transac_email_request_to_item.py | 10 ++++++++++ 6 files changed, 60 insertions(+) diff --git a/src/brevo/transactional_emails/types/send_transac_email_request_bcc_item.py b/src/brevo/transactional_emails/types/send_transac_email_request_bcc_item.py index 29a34ef..97d6966 100644 --- a/src/brevo/transactional_emails/types/send_transac_email_request_bcc_item.py +++ b/src/brevo/transactional_emails/types/send_transac_email_request_bcc_item.py @@ -3,11 +3,21 @@ import typing import pydantic +import typing_extensions from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata from ...core.unchecked_base_model import UncheckedBaseModel class SendTransacEmailRequestBccItem(UncheckedBaseModel): + contact_pixel_tracking_consent: typing_extensions.Annotated[ + typing.Optional[bool], + FieldMetadata(alias="contactPixelTrackingConsent"), + pydantic.Field( + alias="contactPixelTrackingConsent", + description="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.", + ), + ] = None email: str = pydantic.Field() """ BCC recipient email address diff --git a/src/brevo/transactional_emails/types/send_transac_email_request_cc_item.py b/src/brevo/transactional_emails/types/send_transac_email_request_cc_item.py index 9a6c4cf..ba97fa5 100644 --- a/src/brevo/transactional_emails/types/send_transac_email_request_cc_item.py +++ b/src/brevo/transactional_emails/types/send_transac_email_request_cc_item.py @@ -3,11 +3,21 @@ import typing import pydantic +import typing_extensions from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata from ...core.unchecked_base_model import UncheckedBaseModel class SendTransacEmailRequestCcItem(UncheckedBaseModel): + contact_pixel_tracking_consent: typing_extensions.Annotated[ + typing.Optional[bool], + FieldMetadata(alias="contactPixelTrackingConsent"), + pydantic.Field( + alias="contactPixelTrackingConsent", + description="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.", + ), + ] = None email: str = pydantic.Field() """ CC recipient email address diff --git a/src/brevo/transactional_emails/types/send_transac_email_request_message_versions_item_bcc_item.py b/src/brevo/transactional_emails/types/send_transac_email_request_message_versions_item_bcc_item.py index bb4f1ba..85bbc94 100644 --- a/src/brevo/transactional_emails/types/send_transac_email_request_message_versions_item_bcc_item.py +++ b/src/brevo/transactional_emails/types/send_transac_email_request_message_versions_item_bcc_item.py @@ -3,11 +3,21 @@ import typing import pydantic +import typing_extensions from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata from ...core.unchecked_base_model import UncheckedBaseModel class SendTransacEmailRequestMessageVersionsItemBccItem(UncheckedBaseModel): + contact_pixel_tracking_consent: typing_extensions.Annotated[ + typing.Optional[bool], + FieldMetadata(alias="contactPixelTrackingConsent"), + pydantic.Field( + alias="contactPixelTrackingConsent", + description="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.", + ), + ] = None email: str = pydantic.Field() """ BCC recipient email address diff --git a/src/brevo/transactional_emails/types/send_transac_email_request_message_versions_item_cc_item.py b/src/brevo/transactional_emails/types/send_transac_email_request_message_versions_item_cc_item.py index db7f397..0b3d6cc 100644 --- a/src/brevo/transactional_emails/types/send_transac_email_request_message_versions_item_cc_item.py +++ b/src/brevo/transactional_emails/types/send_transac_email_request_message_versions_item_cc_item.py @@ -3,11 +3,21 @@ import typing import pydantic +import typing_extensions from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata from ...core.unchecked_base_model import UncheckedBaseModel class SendTransacEmailRequestMessageVersionsItemCcItem(UncheckedBaseModel): + contact_pixel_tracking_consent: typing_extensions.Annotated[ + typing.Optional[bool], + FieldMetadata(alias="contactPixelTrackingConsent"), + pydantic.Field( + alias="contactPixelTrackingConsent", + description="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.", + ), + ] = None email: str = pydantic.Field() """ CC recipient email address diff --git a/src/brevo/transactional_emails/types/send_transac_email_request_message_versions_item_to_item.py b/src/brevo/transactional_emails/types/send_transac_email_request_message_versions_item_to_item.py index 8c0381a..a704c91 100644 --- a/src/brevo/transactional_emails/types/send_transac_email_request_message_versions_item_to_item.py +++ b/src/brevo/transactional_emails/types/send_transac_email_request_message_versions_item_to_item.py @@ -3,11 +3,21 @@ import typing import pydantic +import typing_extensions from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata from ...core.unchecked_base_model import UncheckedBaseModel class SendTransacEmailRequestMessageVersionsItemToItem(UncheckedBaseModel): + contact_pixel_tracking_consent: typing_extensions.Annotated[ + typing.Optional[bool], + FieldMetadata(alias="contactPixelTrackingConsent"), + pydantic.Field( + alias="contactPixelTrackingConsent", + description="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.", + ), + ] = None email: str = pydantic.Field() """ Email address of the recipient diff --git a/src/brevo/transactional_emails/types/send_transac_email_request_to_item.py b/src/brevo/transactional_emails/types/send_transac_email_request_to_item.py index 7e565fb..8e16cca 100644 --- a/src/brevo/transactional_emails/types/send_transac_email_request_to_item.py +++ b/src/brevo/transactional_emails/types/send_transac_email_request_to_item.py @@ -3,11 +3,21 @@ import typing import pydantic +import typing_extensions from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.serialization import FieldMetadata from ...core.unchecked_base_model import UncheckedBaseModel class SendTransacEmailRequestToItem(UncheckedBaseModel): + contact_pixel_tracking_consent: typing_extensions.Annotated[ + typing.Optional[bool], + FieldMetadata(alias="contactPixelTrackingConsent"), + pydantic.Field( + alias="contactPixelTrackingConsent", + description="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.", + ), + ] = None email: str = pydantic.Field() """ Email address of the recipient