|
9 | 9 | use Illuminate\Notifications\Messages\MailMessage; |
10 | 10 | use Illuminate\Notifications\Messages\SlackMessage; |
11 | 11 | use Illuminate\Notifications\Notification; |
| 12 | +use Illuminate\Support\Str; |
12 | 13 | use NotificationChannels\GoogleChat\Card; |
13 | 14 | use NotificationChannels\GoogleChat\GoogleChatChannel; |
14 | 15 | use NotificationChannels\GoogleChat\GoogleChatMessage; |
@@ -120,6 +121,22 @@ public function toMicrosoftTeams() |
120 | 121 | $item = $this->item; |
121 | 122 | $note = $this->note; |
122 | 123 |
|
| 124 | + if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')) { |
| 125 | + return MicrosoftTeamsMessage::create() |
| 126 | + ->to($this->settings->webhook_endpoint) |
| 127 | + ->type('success') |
| 128 | + ->addStartGroupToSection('activityTitle') |
| 129 | + ->title(trans('mail.Accessory_Checkout_Notification')) |
| 130 | + ->addStartGroupToSection('activityText') |
| 131 | + ->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle') |
| 132 | + ->fact(trans('mail.assigned_to'), $target->present()->name) |
| 133 | + ->fact(trans('general.qty'), $this->checkout_qty) |
| 134 | + ->fact(trans('mail.checkedout_from'), $item->location->name ? $item->location->name : '') |
| 135 | + ->fact(trans('mail.Accessory_Checkout_Notification') . " by ", $admin->present()->fullName()) |
| 136 | + ->fact(trans('admin/consumables/general.remaining'), $item->numRemaining()) |
| 137 | + ->fact(trans('mail.notes'), $note ?: ''); |
| 138 | + } |
| 139 | + |
123 | 140 | $message = trans('mail.Accessory_Checkout_Notification'); |
124 | 141 | $details = [ |
125 | 142 | trans('mail.assigned_to') => $target->present()->name, |
|
0 commit comments