Skip to content

Commit 35185c5

Browse files
committed
Message: #add use of stmp_unique_email when sending email notification - refs BT#22630
1 parent 8b5f707 commit 35185c5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/CoreBundle/Helpers/MessageHelper.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,13 @@ private function sendEmailNotification(User $receiver, User $sender, string $sub
301301
throw new Exception('The receiver does not have a valid email address.');
302302
}
303303

304+
$smtpFromEmail = $sender->getEmail();
305+
if ('true' === $this->settingsManager->getSetting('mail.smtp_unique_sender') && !empty($this->settingsManager->getSetting('mail.smtp_from_email'))) {
306+
$smtpFromEmail = $this->settingsManager->getSetting('mail.smtp_from_email');
307+
}
308+
304309
$email = (new Email())
305-
->from($sender->getEmail())
310+
->from($smtpFromEmail)
306311
->to($receiver->getEmail())
307312
->subject($subject)
308313
->text($content)

0 commit comments

Comments
 (0)