adds check in and checkout message for assets

This commit is contained in:
Godfrey M
2024-10-24 14:39:40 -07:00
parent 18da80e6de
commit e27ff13377
3 changed files with 40 additions and 45 deletions
@@ -141,33 +141,21 @@ class CheckoutAssetNotification extends Notification
->content($note);
});
}
public function toMicrosoftTeams()
public function toMicrosoftTeams() : array
{
$target = $this->target;
$admin = $this->admin;
$item = $this->item;
$note = $this->note;
$notification = new TeamsNotification($this->settings->webhook_channel);
$message = trans('mail.Asset_Checkout_Notification');
$details = [
trans('mail.assigned_to') => $target->present()->name,
htmlspecialchars_decode($item->present()->name) => '',
trans('mail.asset') => htmlspecialchars_decode($item->present()->name),
trans('mail.Asset_Checkout_Notification'). ' by' => $admin->present()->fullName(),
trans('mail.notes') => $note ?: '',
];
return array($message, $details);
// return MicrosoftTeamsMessage::create()
// ->to($this->settings->webhook_endpoint)
// ->type('success')
// ->title()
// ->addStartGroupToSection('activityText')
// ->fact(trans('mail.assigned_to'), $target->present()->name)
// ->fact(htmlspecialchars_decode($item->present()->name), '', 'activityText')
// ->fact(trans('mail.Asset_Checkout_Notification') . " by ", $admin->present()->fullName())
// ->fact(trans('mail.notes'), $note ?: '');
}
public function toGoogleChat()
{