ads check in and checkout message for license seats

This commit is contained in:
Godfrey M 2024-10-24 14:59:10 -07:00
parent cce75a8185
commit 278bc5e52a
3 changed files with 20 additions and 22 deletions

View file

@ -110,17 +110,16 @@ class CheckinLicenseSeatNotification extends Notification
$item = $this->item; $item = $this->item;
$note = $this->note; $note = $this->note;
return MicrosoftTeamsMessage::create() $message = trans('mail.License_Checkin_Notification');
->to($this->settings->webhook_endpoint) $details = [
->type('success') trans('mail.checkedin_from')=> $target->present()->fullName(),
->addStartGroupToSection('activityTitle') trans('mail.license_for') => htmlspecialchars_decode($item->present()->name),
->title(trans('mail.License_Checkin_Notification')) trans('mail.License_Checkin_Notification')." by " => $admin->present()->fullName() ?: 'CLI tool',
->addStartGroupToSection('activityText') trans('admin/consumables/general.remaining') => $item->availCount()->count(),
->fact(htmlspecialchars_decode($item->present()->name), '', 'header') trans('mail.notes') => $note ?: '',
->fact(trans('mail.License_Checkin_Notification')." by ", $admin->present()->fullName() ?: 'CLI tool') ];
->fact(trans('mail.checkedin_from'), $target->present()->fullName())
->fact(trans('admin/consumables/general.remaining'), $item->availCount()->count()) return array($message, $details);
->fact(trans('mail.notes'), $note ?: '');
} }
public function toGoogleChat() public function toGoogleChat()
{ {

View file

@ -125,17 +125,15 @@ class CheckoutLicenseSeatNotification extends Notification
$item = $this->item; $item = $this->item;
$note = $this->note; $note = $this->note;
return MicrosoftTeamsMessage::create() $message = trans('mail.License_Checkout_Notification');
->to($this->settings->webhook_endpoint) $details = [
->type('success') trans('mail.assigned_to') => $target->present()->fullName(),
->addStartGroupToSection('activityTitle') trans('mail.license_for') => htmlspecialchars_decode($item->present()->name),
->title(trans('mail.License_Checkout_Notification')) trans('mail.License_Checkout_Notification').' by' => $admin->present()->fullName(),
->addStartGroupToSection('activityText') trans('admin/consumables/general.remaining') => $item->availCount()->count(),
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle') trans('mail.notes') => $note ?: '',
->fact(trans('mail.License_Checkout_Notification')." by ", $admin->present()->fullName()) ];
->fact(trans('mail.assigned_to'), $target->present()->fullName()) return array($message, $details);
->fact(trans('admin/consumables/general.remaining'), $item->availCount()->count())
->fact(trans('mail.notes'), $note ?: '');
} }
public function toGoogleChat() public function toGoogleChat()
{ {

View file

@ -23,6 +23,7 @@ return [
'Item_Requested' => 'Item Requested', 'Item_Requested' => 'Item Requested',
'License_Checkin_Notification' => 'License checked in', 'License_Checkin_Notification' => 'License checked in',
'License_Checkout_Notification' => 'License checked out', 'License_Checkout_Notification' => 'License checked out',
'license_for' => 'License for',
'Low_Inventory_Report' => 'Low Inventory Report', 'Low_Inventory_Report' => 'Low Inventory Report',
'a_user_canceled' => 'A user has canceled an item request on the website', 'a_user_canceled' => 'A user has canceled an item request on the website',
'a_user_requested' => 'A user has requested an item on the website', 'a_user_requested' => 'A user has requested an item on the website',