Merge pull request #10644 from appwrite/bcc-only-emails

chore: use bcc only emails for smtp
This commit is contained in:
Luke B. Silver 2025-10-14 13:18:36 +01:00 committed by GitHub
commit 3e078027a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 8 deletions

View file

@ -62,7 +62,7 @@
"utopia-php/image": "0.8.*",
"utopia-php/locale": "0.8.*",
"utopia-php/logger": "0.6.*",
"utopia-php/messaging": "0.18.*",
"utopia-php/messaging": "0.19.*",
"utopia-php/migration": "1.*",
"utopia-php/orchestration": "0.9.*",
"utopia-php/platform": "0.7.*",

14
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "773efb29b9b584b1249790e0016c823a",
"content-hash": "568800edca746c4e8d0d50648b25f589",
"packages": [
{
"name": "adhocore/jwt",
@ -4136,16 +4136,16 @@
},
{
"name": "utopia-php/messaging",
"version": "0.18.2",
"version": "0.19.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/messaging.git",
"reference": "0d364edacf4d4867964c7e17f653031dd39394bf"
"reference": "0b866d54e70c792a3c4f5ca9c12a6d358a31f4b8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/messaging/zipball/0d364edacf4d4867964c7e17f653031dd39394bf",
"reference": "0d364edacf4d4867964c7e17f653031dd39394bf",
"url": "https://api.github.com/repos/utopia-php/messaging/zipball/0b866d54e70c792a3c4f5ca9c12a6d358a31f4b8",
"reference": "0b866d54e70c792a3c4f5ca9c12a6d358a31f4b8",
"shasum": ""
},
"require": {
@ -4181,9 +4181,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/messaging/issues",
"source": "https://github.com/utopia-php/messaging/tree/0.18.2"
"source": "https://github.com/utopia-php/messaging/tree/0.19.0"
},
"time": "2025-07-21T18:27:03+00:00"
"time": "2025-10-14T11:46:49+00:00"
},
{
"name": "utopia-php/migration",

View file

@ -593,6 +593,14 @@ class Messaging extends Action
$content = $data['content'];
$html = $data['html'] ?? false;
// For SMTP, move all recipients to BCC and use default recipient in TO field
if ($provider->getAttribute('provider') === 'smtp') {
foreach ($to as $recipient) {
$bcc[] = ['email' => $recipient];
}
$to = [];
}
return new Email(
$to,
$subject,