Skip to content

Commit

Permalink
Merge pull request #4 from screenfluent/fix/mailer-debug-check
Browse files Browse the repository at this point in the history
fix: safely access debug config with null coalescing
  • Loading branch information
mychidarko authored Nov 27, 2024
2 parents a8a3f5e + c966a2d commit 6e51cda
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Mail/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,12 @@ protected static function validate(Mail $mail)
*/
public static function send(Mail $mail)
{
if (static::$config['debug'] === "SERVER") {
$debug = static::$config['debug'] ?? SMTP::DEBUG_OFF;

if ($debug === "SERVER") {
static::$mailer->SMTPDebug = SMTP::DEBUG_SERVER;
} else {
static::$mailer->SMTPDebug = static::$config['debug'] ?? SMTP::DEBUG_OFF;
static::$mailer->SMTPDebug = $debug;
}

if (static::validate($mail)) {
Expand Down

0 comments on commit 6e51cda

Please sign in to comment.