3 namespace BookStack\Activity\Notifications\Messages;
5 use BookStack\Activity\Notifications\LinkedMailMessageLine;
6 use BookStack\Entities\Models\Page;
7 use Illuminate\Notifications\Messages\MailMessage;
9 class PageCreationNotification extends BaseActivityNotification
11 public function toMail(mixed $notifiable): MailMessage
13 /** @var Page $page */
14 $page = $this->detail;
16 return (new MailMessage())
17 ->subject("New Page: " . $page->getShortName())
18 ->line("A new page has been created in " . setting('app-name') . ':')
19 ->line("Page Name: " . $page->name)
20 ->line("Created By: " . $this->user->name)
21 ->action('View Page', $page->getUrl())
22 ->line(new LinkedMailMessageLine(
23 url('/preferences/notifications'),
24 'This notification was sent to you because :link cover this type of activity for this item.',
25 'your notification preferences',