Skip to content

A free open source IT asset/license management system

fix MS Teams Notifications

Godfrey Mc3a0a0415af0
diff --git a/app/Notifications/CheckinAssetNotification.php b/app/Notifications/CheckinAssetNotification.php
index 1b23387ca4..ff2b86d621 100644
--- a/app/Notifications/CheckinAssetNotification.php
+++ b/app/Notifications/CheckinAssetNotification.php
@@ -112,21 +112,21 @@ class CheckinAssetNotification extends Notification
return MicrosoftTeamsMessage::create()
->to($this->settings->webhook_endpoint)
->type('success')
- ->title(trans('mail.Asset_Checkin_Notification', ['tag' => $item->asset_tag]))
+ ->title(trans('mail.Asset_Checkin_Notification', ['tag' => '']))
->addStartGroupToSection('activityText')
->fact(htmlspecialchars_decode($item->display_name), '', 'activityText')
->fact(trans('mail.checked_into'), ($item->location) ? $item->location->name : '')
- ->fact(trans('mail.Asset_Checkin_Notification') . " by ", $admin->display_name)
+ ->fact(trans('general.administrator'), $admin->display_name)
->fact(trans('admin/hardware/form.status'), $item->assetstatus?->name)
->fact(trans('mail.notes'), $note ?: '');
}
- $message = trans('mail.Asset_Checkin_Notification', ['tag' => $item->asset_tag]);
+ $message = trans('mail.Asset_Checkin_Notification', ['tag' => '']);
$details = [
trans('mail.asset') => htmlspecialchars_decode($item->display_name),
trans('mail.checked_into') => ($item->location) ? $item->location->name : '',
- trans('mail.Asset_Checkin_Notification')." by " => $admin->display_name,
+ trans('general.administrator') => $admin->display_name,
trans('admin/hardware/form.status') => $item->assetstatus?->name,
trans('mail.notes') => $note ?: '',
];
diff --git a/app/Notifications/CheckoutAssetNotification.php b/app/Notifications/CheckoutAssetNotification.php
index 9e11a3cbaf..4a6f3fdfe9 100644
--- a/app/Notifications/CheckoutAssetNotification.php
+++ b/app/Notifications/CheckoutAssetNotification.php
@@ -131,19 +131,19 @@ class CheckoutAssetNotification extends Notification
return MicrosoftTeamsMessage::create()
->to($this->settings->webhook_endpoint)
->type('success')
- ->title(trans('mail.Asset_Checkout_Notification', ['tag' => $item->asset_tag]))
+ ->title(trans('mail.Asset_Checkout_Notification', ['tag' => '']))
->addStartGroupToSection('activityText')
->fact(trans('mail.assigned_to'), $target->display_name)
->fact(htmlspecialchars_decode($item->display_name), '', 'activityText')
- ->fact(trans('mail.Asset_Checkout_Notification', ['tag' => $item->asset_tag]) . " by ", $admin->display_name)
+ ->fact(trans('general.administrator'), $admin->display_name)
->fact(trans('mail.notes'), $note ?: '');
}
- $message = trans('mail.Asset_Checkout_Notification', ['tag' => $item->asset_tag]);
+ $message = trans('mail.Asset_Checkout_Notification', ['tag' => '']);
$details = [
trans('mail.assigned_to') => $target->present()->name,
trans('mail.asset') => htmlspecialchars_decode($item->display_name),
- trans('mail.Asset_Checkout_Notification', ['tag' => $item->asset_tag]). ' by' => $admin->display_name,
+ trans('general.administrator') => $admin->display_name,
trans('mail.notes') => $note ?: '',
];
return array($message, $details);
diff --git a/resources/lang/en-US/mail.php b/resources/lang/en-US/mail.php
index 910c860e2c..53e0c1dc83 100644
--- a/resources/lang/en-US/mail.php
+++ b/resources/lang/en-US/mail.php
@@ -4,8 +4,8 @@ return [
'Accessory_Checkin_Notification' => 'Accessory checked in',
'Accessory_Checkout_Notification' => 'Accessory checked out',
- 'Asset_Checkin_Notification' => 'Asset checked in: [:tag]',
- 'Asset_Checkout_Notification' => 'Asset checked out: [:tag]',
+ 'Asset_Checkin_Notification' => 'Asset checked in: :tag',
+ 'Asset_Checkout_Notification' => 'Asset checked out: :tag',
'Confirm_Accessory_Checkin' => 'Accessory checkin confirmation',
'Confirm_Asset_Checkin' => 'Asset checkin confirmation',
'Confirm_component_checkin' => 'Component checkin confirmation',