remove old notify by mail from consumable notification

This commit is contained in:
Godfrey M 2024-10-23 15:08:29 -07:00
parent c681946b1d
commit fd74c35102

View file

@ -39,6 +39,7 @@ class CheckoutConsumableNotification extends Notification
$this->note = $note;
$this->target = $checkedOutTo;
$this->acceptance = $acceptance;
$this->qty = $consumable->checkout_qty;
$this->settings = Setting::getSettings();
}
@ -65,34 +66,6 @@ class CheckoutConsumableNotification extends Notification
$notifyBy[] = SlackWebhookChannel::class;
}
/**
* Only send notifications to users that have email addresses
*/
if ($this->target instanceof User && $this->target->email != '') {
/**
* Send an email if the asset requires acceptance,
* so the user can accept or decline the asset
*/
if ($this->item->requireAcceptance()) {
$notifyBy[1] = 'mail';
}
/**
* Send an email if the item has a EULA, since the user should always receive it
*/
if ($this->item->getEula()) {
$notifyBy[1] = 'mail';
}
/**
* Send an email if an email should be sent at checkin/checkout
*/
if ((method_exists($this->item, 'checkin_email')) && ($this->item->checkin_email())) {
$notifyBy[1] = 'mail';
}
}
return $notifyBy;
}