mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
merged in develop
This commit is contained in:
parent
d6ba303f39
commit
b26cae372c
|
@ -717,7 +717,7 @@ class Helper
|
||||||
* @since [v7.0.14]
|
* @since [v7.0.14]
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function deprecationCheck(){
|
public static function deprecationCheck() : array {
|
||||||
// The check and message that the user is still using the deprecated version
|
// The check and message that the user is still using the deprecated version
|
||||||
$deprecations = [
|
$deprecations = [
|
||||||
'ms_teams_deprecated' => array(
|
'ms_teams_deprecated' => array(
|
||||||
|
|
|
@ -30,6 +30,7 @@ use Illuminate\Support\Facades\Mail;
|
||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Osama\LaravelTeamsNotification\TeamsNotification;
|
||||||
|
|
||||||
class CheckoutableListener
|
class CheckoutableListener
|
||||||
{
|
{
|
||||||
|
@ -80,11 +81,16 @@ class CheckoutableListener
|
||||||
Log::info('Sending email, Locale: ' . ($event->checkedOutTo->locale ?? 'default'));
|
Log::info('Sending email, Locale: ' . ($event->checkedOutTo->locale ?? 'default'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send Webhook notification
|
// Send Webhook notification
|
||||||
if ($this->shouldSendWebhookNotification()) {
|
if ($this->shouldSendWebhookNotification()) {
|
||||||
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
|
if (Setting::getSettings()->webhook_selected === 'microsoft') {
|
||||||
->notify($this->getCheckoutNotification($event, $acceptance));
|
$message = $this->getCheckoutNotification($event)->toMicrosoftTeams();
|
||||||
|
$notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint);
|
||||||
|
$notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams
|
||||||
|
} else {
|
||||||
|
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
|
||||||
|
->notify($this->getCheckoutNotification($event, $acceptance));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (ClientException $e) {
|
} catch (ClientException $e) {
|
||||||
Log::debug("Exception caught during checkout notification: " . $e->getMessage());
|
Log::debug("Exception caught during checkout notification: " . $e->getMessage());
|
||||||
|
|
|
@ -64,7 +64,7 @@ class SlackSettingsForm extends Component
|
||||||
"name" => trans('admin/settings/general.ms_teams'),
|
"name" => trans('admin/settings/general.ms_teams'),
|
||||||
"icon" => "fa-brands fa-microsoft",
|
"icon" => "fa-brands fa-microsoft",
|
||||||
"placeholder" => "https://abcd.webhook.office.com/webhookb2/XXXXXXX",
|
"placeholder" => "https://abcd.webhook.office.com/webhookb2/XXXXXXX",
|
||||||
"link" => "https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook?tabs=dotnet#create-incoming-webhooks-1",
|
"link" => "https://support.microsoft.com/en-us/office/create-incoming-webhooks-with-workflows-for-microsoft-teams-8ae491c7-0394-4861-ba59-055e33f75498",
|
||||||
"test" => "msTeamTestWebhook"
|
"test" => "msTeamTestWebhook"
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue