]> BookStack Code Mirror - bookstack/blob - app/Activity/Notifications/Messages/PageCreationNotification.php
2e9a6debcb6bc191d4bd4963d05b5f6e50a6c166
[bookstack] / app / Activity / Notifications / Messages / PageCreationNotification.php
1 <?php
2
3 namespace BookStack\Activity\Notifications\Messages;
4
5 use BookStack\Activity\Notifications\LinkedMailMessageLine;
6 use BookStack\Entities\Models\Page;
7 use Illuminate\Notifications\Messages\MailMessage;
8
9 class PageCreationNotification extends BaseActivityNotification
10 {
11     public function toMail(mixed $notifiable): MailMessage
12     {
13         /** @var Page $page */
14         $page = $this->detail;
15
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',
26             ));
27     }
28 }