From 752520470d858fb6adea17d8b8bfef0534e31400 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 14 Oct 2025 09:27:50 +0530 Subject: [PATCH] fix: param --- src/Appwrite/Platform/Workers/Messaging.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index 8c62ae32b8..1a714c232c 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -592,18 +592,15 @@ class Messaging extends Action $subject = $data['subject']; $content = $data['content']; $html = $data['html'] ?? false; + $defaultRecipient = System::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM); // For SMTP, move all recipients to BCC and use default recipient in TO field if ($provider->getAttribute('provider') === 'smtp') { - $defaultRecipient = System::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM); - - if ($defaultRecipient) { - foreach ($to as $recipient) { - $bcc[] = ['email' => $recipient]; - } - - $to = [$defaultRecipient]; + foreach ($to as $recipient) { + $bcc[] = ['email' => $recipient]; } + + $to = []; } return new Email( @@ -617,7 +614,8 @@ class Messaging extends Action $cc, $bcc, $attachments, - $html + $html, + $defaultRecipient ); }