diff options
| author | David Siegfried <david.siegfried@uni-vechta.de> | 2026-02-27 14:30:48 +0100 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2026-02-27 14:30:48 +0100 |
| commit | 2ad4e119605f9a026972b69a85f7f049923b62a5 (patch) | |
| tree | 8416858a5cfad38b9d41ed9ff2752e20a08edd77 /lib/classes | |
| parent | ea34e14ba1afffd8e6ecfa258836236419d2b46e (diff) | |
use non-static mailer, re #2311step-2311
Diffstat (limited to 'lib/classes')
| -rw-r--r-- | lib/classes/StudipMail.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/classes/StudipMail.php b/lib/classes/StudipMail.php index 7fb7eec..0081ccf 100644 --- a/lib/classes/StudipMail.php +++ b/lib/classes/StudipMail.php @@ -29,7 +29,7 @@ class StudipMail public const SMTP_TRANSPORTER = 'smtp'; - private static ?Mailer $mailer = null; + private ?Mailer $mailer; private static string $transporter; @@ -153,18 +153,16 @@ class StudipMail self::NULL_TRANSPORTER => 'null://null', default => $this->buildSmtpDsn() }; - if (!self::$mailer) { - if (self::getDefaultTransporter() === self::DEBUG_TRANSPORTER) { - $transport = new StudipDebugTransport( - $GLOBALS['TMP_PATH'] . '/' . - ($GLOBALS['DEBUG_MAIL_LOG_FILE_NAME'] ?? 'studip-mail-debug.log') - ); - } else { - $transport = Transport::fromDsn($dsn); - } - self::$mailer = new Mailer($transport); + if (self::getDefaultTransporter() === self::DEBUG_TRANSPORTER) { + $transport = new StudipDebugTransport( + $GLOBALS['TMP_PATH'] . '/' . + ($GLOBALS['DEBUG_MAIL_LOG_FILE_NAME'] ?? 'studip-mail-debug.log') + ); + } else { + $transport = Transport::fromDsn($dsn); } - $this->mailer = self::$mailer; + + $this->mailer = new Mailer($transport); $mail_localhost = $GLOBALS['MAIL_LOCALHOST'] ?: $_SERVER['SERVER_NAME']; $this->setSenderEmail($GLOBALS['MAIL_ENV_FROM'] ?: "wwwrun@{$mail_localhost}"); $this->setSenderName($GLOBALS['MAIL_FROM'] ?: 'Stud.IP - ' . Config::get()->UNI_NAME_CLEAN); |
