mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
fix: param
This commit is contained in:
parent
128cd68ec8
commit
752520470d
1 changed files with 7 additions and 9 deletions
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue