Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ public function getEvent(): JobFailed

public function toMail($notifiable): MailMessage
{
return (new MailMessage())
return (new MailMessage)
->error()
->subject('A job failed at '.config('app.url'))
->line("Exception message: {$this->event->exception->getMessage()}")
->line("Job class: {$this->event->job->resolveName()}")
->line("Job body: {$this->event->job->getRawBody()}")
->line("Exception: {$this->event->exception->getTraceAsString()}");
->line("Exception: {$this->event->exception->getTraceAsString()}")
->action('View Error', url(config('horizon.path').'/failed/'.$this->event->job->getJobId()));
}

public function toSlack(): SlackMessage
{
return (new SlackMessage())
return (new SlackMessage)
->error()
->content('A job failed at '.config('app.url'))
->attachment(function (SlackAttachment $attachment) {
Expand Down