mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-03 09:57:45 -08:00
Merge pull request #15806 from Godmartinz/improved-checkoutable-logging
improved logging in checkoutable listener
This commit is contained in:
commit
f2fc11035f
|
@ -78,12 +78,13 @@ class CheckoutableListener
|
||||||
|
|
||||||
if ($event->checkoutable->requireAcceptance() || $event->checkoutable->getEula() ||
|
if ($event->checkoutable->requireAcceptance() || $event->checkoutable->getEula() ||
|
||||||
(method_exists($event->checkoutable, 'checkin_email') && $event->checkoutable->checkin_email())) {
|
(method_exists($event->checkoutable, 'checkin_email') && $event->checkoutable->checkin_email())) {
|
||||||
|
Log::info('Sending checkout email, Locale: ' . ($event->checkedOutTo->locale ?? 'default'));
|
||||||
if (!empty($notifiable)) {
|
if (!empty($notifiable)) {
|
||||||
Mail::to($notifiable)->cc($ccEmails)->send($mailable);
|
Mail::to($notifiable)->cc($ccEmails)->send($mailable);
|
||||||
} elseif (!empty($ccEmails)) {
|
} elseif (!empty($ccEmails)) {
|
||||||
Mail::cc($ccEmails)->send($mailable);
|
Mail::cc($ccEmails)->send($mailable);
|
||||||
}
|
}
|
||||||
Log::info('Sending email, Locale: ' . ($event->checkedOutTo->locale ?? 'default'));
|
Log::info('Checkout Mail sent.');
|
||||||
}
|
}
|
||||||
} catch (ClientException $e) {
|
} catch (ClientException $e) {
|
||||||
Log::debug("Exception caught during checkout email: " . $e->getMessage());
|
Log::debug("Exception caught during checkout email: " . $e->getMessage());
|
||||||
|
@ -159,12 +160,13 @@ class CheckoutableListener
|
||||||
*/
|
*/
|
||||||
if ($event->checkoutable->requireAcceptance() || $event->checkoutable->getEula() ||
|
if ($event->checkoutable->requireAcceptance() || $event->checkoutable->getEula() ||
|
||||||
(method_exists($event->checkoutable, 'checkin_email') && $event->checkoutable->checkin_email())) {
|
(method_exists($event->checkoutable, 'checkin_email') && $event->checkoutable->checkin_email())) {
|
||||||
|
Log::info('Sending checkin email, Locale: ' . ($event->checkedOutTo->locale ?? 'default'));
|
||||||
if (!empty($notifiable)) {
|
if (!empty($notifiable)) {
|
||||||
Mail::to($notifiable)->cc($ccEmails)->send($mailable);
|
Mail::to($notifiable)->cc($ccEmails)->send($mailable);
|
||||||
} elseif (!empty($ccEmails)){
|
} elseif (!empty($ccEmails)){
|
||||||
Mail::cc($ccEmails)->send($mailable);
|
Mail::cc($ccEmails)->send($mailable);
|
||||||
}
|
}
|
||||||
Log::info('Sending email, Locale: ' . $event->checkedOutTo->locale);
|
Log::info('Checkin Mail sent.');
|
||||||
}
|
}
|
||||||
} catch (ClientException $e) {
|
} catch (ClientException $e) {
|
||||||
Log::debug("Exception caught during checkin email: " . $e->getMessage());
|
Log::debug("Exception caught during checkin email: " . $e->getMessage());
|
||||||
|
|
Loading…
Reference in a new issue