Skip to content

Commit 278bc5e

Browse files
committed
ads check in and checkout message for license seats
1 parent cce75a8 commit 278bc5e

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed

app/Notifications/CheckinLicenseSeatNotification.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,16 @@ public function toMicrosoftTeams()
110110
$item = $this->item;
111111
$note = $this->note;
112112

113-
return MicrosoftTeamsMessage::create()
114-
->to($this->settings->webhook_endpoint)
115-
->type('success')
116-
->addStartGroupToSection('activityTitle')
117-
->title(trans('mail.License_Checkin_Notification'))
118-
->addStartGroupToSection('activityText')
119-
->fact(htmlspecialchars_decode($item->present()->name), '', 'header')
120-
->fact(trans('mail.License_Checkin_Notification')." by ", $admin->present()->fullName() ?: 'CLI tool')
121-
->fact(trans('mail.checkedin_from'), $target->present()->fullName())
122-
->fact(trans('admin/consumables/general.remaining'), $item->availCount()->count())
123-
->fact(trans('mail.notes'), $note ?: '');
113+
$message = trans('mail.License_Checkin_Notification');
114+
$details = [
115+
trans('mail.checkedin_from')=> $target->present()->fullName(),
116+
trans('mail.license_for') => htmlspecialchars_decode($item->present()->name),
117+
trans('mail.License_Checkin_Notification')." by " => $admin->present()->fullName() ?: 'CLI tool',
118+
trans('admin/consumables/general.remaining') => $item->availCount()->count(),
119+
trans('mail.notes') => $note ?: '',
120+
];
121+
122+
return array($message, $details);
124123
}
125124
public function toGoogleChat()
126125
{

app/Notifications/CheckoutLicenseSeatNotification.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,15 @@ public function toMicrosoftTeams()
125125
$item = $this->item;
126126
$note = $this->note;
127127

128-
return MicrosoftTeamsMessage::create()
129-
->to($this->settings->webhook_endpoint)
130-
->type('success')
131-
->addStartGroupToSection('activityTitle')
132-
->title(trans('mail.License_Checkout_Notification'))
133-
->addStartGroupToSection('activityText')
134-
->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle')
135-
->fact(trans('mail.License_Checkout_Notification')." by ", $admin->present()->fullName())
136-
->fact(trans('mail.assigned_to'), $target->present()->fullName())
137-
->fact(trans('admin/consumables/general.remaining'), $item->availCount()->count())
138-
->fact(trans('mail.notes'), $note ?: '');
128+
$message = trans('mail.License_Checkout_Notification');
129+
$details = [
130+
trans('mail.assigned_to') => $target->present()->fullName(),
131+
trans('mail.license_for') => htmlspecialchars_decode($item->present()->name),
132+
trans('mail.License_Checkout_Notification').' by' => $admin->present()->fullName(),
133+
trans('admin/consumables/general.remaining') => $item->availCount()->count(),
134+
trans('mail.notes') => $note ?: '',
135+
];
136+
return array($message, $details);
139137
}
140138
public function toGoogleChat()
141139
{

resources/lang/en-US/mail.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
'Item_Requested' => 'Item Requested',
2424
'License_Checkin_Notification' => 'License checked in',
2525
'License_Checkout_Notification' => 'License checked out',
26+
'license_for' => 'License for',
2627
'Low_Inventory_Report' => 'Low Inventory Report',
2728
'a_user_canceled' => 'A user has canceled an item request on the website',
2829
'a_user_requested' => 'A user has requested an item on the website',

0 commit comments

Comments
 (0)