-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new end notification (#56)
separate edited and closed operation notifications to their own.
- Loading branch information
1 parent
e0d57ff
commit 0cfba64
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Seat\Kassie\Calendar\Notifications; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Notifications\Notification; | ||
use Illuminate\Notifications\Messages\SlackMessage; | ||
use Seat\Kassie\Calendar\Helpers\Helper; | ||
|
||
/** | ||
* Class OperationEnded. | ||
* | ||
* @package Seat\Kassie\Calendar\Notifications | ||
*/ | ||
class OperationEnded extends Notification | ||
{ | ||
use Queueable; | ||
|
||
/** | ||
* @param $notifiable | ||
* @return array | ||
*/ | ||
public function via($notifiable) | ||
{ | ||
return ['slack']; | ||
} | ||
|
||
/** | ||
* @param $notifiable | ||
* @return mixed | ||
*/ | ||
public function toSlack($notifiable) | ||
{ | ||
$attachment = Helper::BuildSlackNotificationAttachment($notifiable); | ||
|
||
return (new SlackMessage) | ||
->success() | ||
->from('SeAT Calendar', ':calendar:') | ||
->content(trans('calendar::seat.notification_end_operation')) | ||
->attachment($attachment); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters