mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
chore: use bcc only emails for smtp
This commit is contained in:
parent
a832343348
commit
128cd68ec8
1 changed files with 13 additions and 0 deletions
|
|
@ -593,6 +593,19 @@ 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') {
|
||||
$defaultRecipient = System::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM);
|
||||
|
||||
if ($defaultRecipient) {
|
||||
foreach ($to as $recipient) {
|
||||
$bcc[] = ['email' => $recipient];
|
||||
}
|
||||
|
||||
$to = [$defaultRecipient];
|
||||
}
|
||||
}
|
||||
|
||||
return new Email(
|
||||
$to,
|
||||
$subject,
|
||||
|
|
|
|||
Loading…
Reference in a new issue