Skip to content

Commit 3e07802

Browse files
authored
Merge pull request #10644 from appwrite/bcc-only-emails
chore: use bcc only emails for smtp
2 parents a832343 + 97f448f commit 3e07802

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"utopia-php/image": "0.8.*",
6363
"utopia-php/locale": "0.8.*",
6464
"utopia-php/logger": "0.6.*",
65-
"utopia-php/messaging": "0.18.*",
65+
"utopia-php/messaging": "0.19.*",
6666
"utopia-php/migration": "1.*",
6767
"utopia-php/orchestration": "0.9.*",
6868
"utopia-php/platform": "0.7.*",

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Appwrite/Platform/Workers/Messaging.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,14 @@ private function buildEmailMessage(
593593
$content = $data['content'];
594594
$html = $data['html'] ?? false;
595595

596+
// For SMTP, move all recipients to BCC and use default recipient in TO field
597+
if ($provider->getAttribute('provider') === 'smtp') {
598+
foreach ($to as $recipient) {
599+
$bcc[] = ['email' => $recipient];
600+
}
601+
$to = [];
602+
}
603+
596604
return new Email(
597605
$to,
598606
$subject,

0 commit comments

Comments
 (0)