From a33b4416f2d0fd05238b304b807333748dd4ee2f Mon Sep 17 00:00:00 2001 From: Maxime Renou Date: Tue, 19 May 2020 18:26:20 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'src/BluescaleMailA?= =?UTF-8?q?pi.php'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BluescaleMailApi.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/BluescaleMailApi.php b/src/BluescaleMailApi.php index 0c5c13c..06630c4 100644 --- a/src/BluescaleMailApi.php +++ b/src/BluescaleMailApi.php @@ -32,8 +32,10 @@ class BluescaleMailApi $client = new Client(); - $notifiable_recipient = false; - if (is_object($notifiable) && $notifiable_email = $notifiable->email) { + if (is_object($notifiable) && isset($notifiable->email)) + { + $notifiable_recipient = false; + $notifiable_email = $notifiable->email; $recipients = $template->recipients; if (count($recipients) > 0) @@ -41,12 +43,13 @@ class BluescaleMailApi if (!empty($recipient['address'])) if ($notifiable_email == $recipient['address']) $notifiable_recipient = true; - } + - if (!$notifiable_recipient) - $template->recipients[] = [ - 'address' => $notifiable->email - ]; + if (!$notifiable_recipient) + $template->recipients[] = [ + 'address' => $notifiable->email + ]; + } try { return $client->request('post', $url, [