From 70418e92cd8faab170a50f6c2489bfbdd30d38a3 Mon Sep 17 00:00:00 2001 From: Matteo Baccarin Date: Fri, 27 Dec 2019 15:56:20 +0100 Subject: [PATCH] Fix namespace email --- modules/emails/src/EmailHook.php | 3 ++- src/Notifications/EmailNotification.php | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/emails/src/EmailHook.php b/modules/emails/src/EmailHook.php index ee698cff1..55ff8182e 100644 --- a/modules/emails/src/EmailHook.php +++ b/modules/emails/src/EmailHook.php @@ -5,6 +5,7 @@ namespace Modules\Emails; use Carbon\Carbon; use Hooks\Manager; use Notifications\EmailNotification; +use PHPMailer\PHPMailer\Exception; class EmailHook extends Manager { @@ -72,7 +73,7 @@ class EmailHook extends Manager try { // Invio mail $email->send(); - } catch (PHPMailer\PHPMailer\Exception $e) { + } catch (Exception $e) { } } diff --git a/src/Notifications/EmailNotification.php b/src/Notifications/EmailNotification.php index a32b9462e..4cb8d75d5 100644 --- a/src/Notifications/EmailNotification.php +++ b/src/Notifications/EmailNotification.php @@ -4,6 +4,8 @@ namespace Notifications; use Modules\Emails\Account; use PHPMailer\PHPMailer\PHPMailer; +use PHPMailer\PHPMailer\Exception; +use Modules\Emails\Mail; use Prints; use Uploads; @@ -71,7 +73,7 @@ class EmailNotification extends PHPMailer implements NotificationInterface $this->WordWrap = 78; } - public static function build(\Modules\Emails\Mail $mail, $exceptions = null) + public static function build(Mail $mail, $exceptions = null) { $result = new self($mail->account->id, $exceptions); @@ -146,7 +148,7 @@ class EmailNotification extends PHPMailer implements NotificationInterface $exception = null; try { $result = parent::send(); - } catch (PHPMailer\PHPMailer\Exception $e) { + } catch (Exception $e) { $result = false; $exception = $e; }