forked from miguel456/rbrecruiter
RSM-38 Added Discord Routing for relevant notifications
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Notifications;
|
||||
|
||||
use App\Traits\DiscordRoutable;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
@@ -15,7 +16,7 @@ use App\Facades\Options;
|
||||
|
||||
class NewApplicant extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable, Cancellable;
|
||||
use Queueable, Cancellable, DiscordRoutable;
|
||||
|
||||
|
||||
protected $application;
|
||||
@@ -37,12 +38,7 @@ class NewApplicant extends Notification implements ShouldQueue
|
||||
|
||||
public function channels()
|
||||
{
|
||||
if (Options::getOption('enable_slack_notifications') == 1)
|
||||
{
|
||||
return ['slack'];
|
||||
}
|
||||
|
||||
return [];
|
||||
$this->chooseChannelsViaOptions();
|
||||
}
|
||||
|
||||
public function optOut($notifiable)
|
||||
@@ -91,6 +87,12 @@ class NewApplicant extends Notification implements ShouldQueue
|
||||
->action('Review application', $url);
|
||||
});
|
||||
}
|
||||
|
||||
public function toDiscord($notifiable)
|
||||
{
|
||||
return $this->toSlack($notifiable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
|
Reference in New Issue
Block a user