Skip to content

Commit

Permalink
Hide link in mail when not using Horizon (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdheiden authored Jul 16, 2024
1 parent ff7f090 commit 1b4c4d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function toMail($notifiable): MailMessage
->line("Job class: {$this->event->job->resolveName()}")
->line("Job body: {$this->event->job->getRawBody()}")
->line("Exception: {$this->event->exception->getTraceAsString()}")
->action('View Error', url(config('horizon.path').'/failed/'.$this->event->job->getJobId()));
->when(config('horizon') !== null, fn (MailMessage $mailMessage) => $mailMessage->action('View Error', url(config('horizon.path').'/failed/'.$this->event->job->getJobId())));
}

public function toSlack(): SlackMessage
Expand Down

0 comments on commit 1b4c4d3

Please sign in to comment.