feat: use new notification event names

This commit is contained in:
peaklabs-dev
2024-12-09 16:57:15 +01:00
parent bc726ddd6e
commit b6500142c4
12 changed files with 75 additions and 150 deletions

View File

@@ -5,8 +5,8 @@ namespace App\Notifications\ScheduledTask;
use App\Models\ScheduledTask;
use App\Notifications\CustomEmailNotification;
use App\Notifications\Dto\DiscordMessage;
use Illuminate\Notifications\Messages\MailMessage;
use App\Notifications\Dto\SlackMessage;
use Illuminate\Notifications\Messages\MailMessage;
class TaskFailed extends CustomEmailNotification
{
@@ -24,7 +24,7 @@ class TaskFailed extends CustomEmailNotification
public function via(object $notifiable): array
{
return setNotificationChannels($notifiable, 'scheduled_tasks');
return $notifiable->getEnabledChannels('scheduled_task_failure');
}
public function toMail(): MailMessage
@@ -49,7 +49,7 @@ class TaskFailed extends CustomEmailNotification
);
if ($this->url) {
$message->addField('Scheduled task', '[Link](' . $this->url . ')');
$message->addField('Scheduled task', '[Link]('.$this->url.')');
}
return $message;
@@ -72,7 +72,7 @@ class TaskFailed extends CustomEmailNotification
public function toSlack(): SlackMessage
{
$title = "Scheduled task failed";
$title = 'Scheduled task failed';
$description = "Scheduled task ({$this->task->name}) failed.";
if ($this->output) {