Skip to content

Commit

Permalink
Fixed undefined exception in log message (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Dec 11, 2023
1 parent 5c1027e commit 73f3c43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/NotificationCenter/Gateway/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,13 @@ public function sendDraft(EmailMessageDraft $objDraft)
try {
$blnSent = $objEmail->sendTo($objDraft->getRecipientEmails());
} catch (\Exception $e) {
$blnSent = false;
\System::log(sprintf('Could not send email to "%s" for message ID %s: %s', implode(', ', $objDraft->getRecipientEmails()), $objDraft->getMessage()->id, $e->getMessage()), __METHOD__, TL_ERROR);

return false;
}

if (!$blnSent) {
\System::log(sprintf('Could not send email to "%s" for message ID %s: %s', implode(', ', $objDraft->getRecipientEmails()), $objDraft->getMessage()->id, $e->getMessage()), __METHOD__, TL_ERROR);
\System::log(sprintf('Could not send email to "%s" for message ID %s', implode(', ', $objDraft->getRecipientEmails()), $objDraft->getMessage()->id), __METHOD__, TL_ERROR);
}

return $blnSent;
Expand Down

0 comments on commit 73f3c43

Please sign in to comment.