Skip to content

Commit

Permalink
Check for admin for slack notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Aug 14, 2020
1 parent e52919c commit b5acca8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions app/Notifications/CheckinLicenseNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,18 @@ public function toSlack($notifiable)
$botname = ($this->settings->slack_botname) ? $this->settings->slack_botname : 'Snipe-Bot' ;


$fields = [
'To' => '<'.$target->present()->viewUrl().'|'.$target->present()->fullName().'>',
'By' => '<'.$admin->present()->viewUrl().'|'.$admin->present()->fullName().'>',
];
if ($admin) {
$fields = [
'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',
];
}




Expand Down

0 comments on commit b5acca8

Please sign in to comment.