3 namespace BookStack\Activity\Notifications\Messages;
5 use BookStack\Activity\Models\Loggable;
6 use BookStack\Activity\Notifications\MessageParts\LinkedMailMessageLine;
7 use BookStack\Users\Models\User;
8 use Illuminate\Bus\Queueable;
9 use Illuminate\Notifications\Messages\MailMessage;
10 use Illuminate\Notifications\Notification;
12 abstract class BaseActivityNotification extends Notification
16 public function __construct(
17 protected Loggable|string $detail,
23 * Get the notification's delivery channels.
25 * @param mixed $notifiable
28 public function via($notifiable)
34 * Get the mail representation of the notification.
36 abstract public function toMail(mixed $notifiable): MailMessage;
39 * Get the array representation of the notification.
41 * @param mixed $notifiable
44 public function toArray($notifiable)
47 'activity_detail' => $this->detail,
48 'activity_creator' => $this->user,
53 * Build the common reason footer line used in mail messages.
55 protected function buildReasonFooterLine(): LinkedMailMessageLine
57 return new LinkedMailMessageLine(
58 url('/preferences/notifications'),
59 trans('notifications.footer_reason'),
60 trans('notifications.footer_reason_link'),