Skip to content

Commit 1b4c4d3

Browse files
authored
Hide link in mail when not using Horizon (#85)
1 parent ff7f090 commit 1b4c4d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Notification.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function toMail($notifiable): MailMessage
3838
->line("Job class: {$this->event->job->resolveName()}")
3939
->line("Job body: {$this->event->job->getRawBody()}")
4040
->line("Exception: {$this->event->exception->getTraceAsString()}")
41-
->action('View Error', url(config('horizon.path').'/failed/'.$this->event->job->getJobId()));
41+
->when(config('horizon') !== null, fn (MailMessage $mailMessage) => $mailMessage->action('View Error', url(config('horizon.path').'/failed/'.$this->event->job->getJobId())));
4242
}
4343

4444
public function toSlack(): SlackMessage

0 commit comments

Comments
 (0)