Skip to content

[Mailer][Sweego] Add support for CC and BCC recipients - #65879

Merged
nicolas-grekas merged 1 commit into
symfony:8.2from
lazerg:fix/issue-65878-sweego-cc-bcc
Sep 7, 2026
Merged

nicolas-grekas merged 1 commit into
symfony:8.2from
lazerg:fix/issue-65878-sweego-cc-bcc

Conversation

@lazerg

@lazerg lazerg commented Sep 7, 2026

Copy link
Copy Markdown
Contributor
Q A
Branch? 8.2
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #65878
License MIT

The Sweego bridge never sent CC and BCC recipients to the API. getRecipients() strips them from the envelope, and the payload only carried recipients, so anyone added with $email->cc() or $email->bcc() was silently dropped while their address still leaked through as a custom Cc/Bcc header.

The API accepts cc and bcc alongside recipients, with the same {email, name} shape, so the payload now fills them from the message and the two headers are excluded like To already was.

$email->to('tony.stark@marvel.com')
    ->cc('pepper@marvel.com')
    ->bcc('nick.fury@marvel.com');

@lazerg

lazerg commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

The four red jobs fail in Messenger and HttpClient on tests that are timing-dependent. This change only touches the Sweego mailer bridge, so the failures do not come from it.

@welcoMattic

Copy link
Copy Markdown
Member

I checked the payload against the OpenAPI schema behind https://learn.sweego.io/docs/sweego/send-send-post (ModelInSendEmail): cc and bcc are optional arrays of ModelRecipientEmail ({email: required, name: optional}), same shape as recipients, so the implementation matches the API.

One thing worth noting, not introduced by this PR: recipients is required with minItems: 1. An email with only Bcc recipients (no To) ends up with recipients: [], since getRecipients() strips Cc and Bcc from the envelope, and the API will reject it. It was already the case before, but now that Bcc are actually forwarded it may be more visible. Either an explicit exception in the transport or a note in the docs could help.

@nicolas-grekas

Copy link
Copy Markdown
Member

Thank you @lazerg.

@nicolas-grekas
nicolas-grekas merged commit c2f0eeb into symfony:8.2 Sep 7, 2026
9 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Mailer][SweegoTransport] Add (B)CC recipient support to the Sweego bridge

6 participants

Sponsor
SponsoredKunjungi sekarang
Promo