Check for admin for slack notifications

This commit is contained in:
snipe 2020-08-14 16:02:15 -07:00
parent e52919cf1b
commit b5acca89d7
No known key found for this signature in database
GPG key ID: 10BFFDA3ED34B5AC

View file

@ -76,10 +76,18 @@ class CheckinLicenseNotification extends Notification
$botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot' ; $botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot' ;
$fields = [ if ($admin) {
'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>', $fields = [
'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>', 'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
]; 'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
];
} else {
$fields = [
'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
'By' => 'CLI tool',
];
}