]> BookStack Code Mirror - bookstack/blob - app/Activity/Notifications/Messages/PageUpdateNotification.php
f29f50dde44ed0170557a97a50edb8a6ca55d71d
[bookstack] / app / Activity / Notifications / Messages / PageUpdateNotification.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 PageUpdateNotification 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("Updated Page: " . $page->getShortName())
18             ->line("A page has been updated in " . setting('app-name') . ':')
19             ->line("Page Name: " . $page->name)
20             ->line("Updated By: " . $this->user->name)
21             ->line("To prevent a mass of notifications, for a while you won't be sent notifications for further edits to this page by the same editor.")
22             ->action('View Page', $page->getUrl())
23             ->line(new LinkedMailMessageLine(
24                 url('/preferences/notifications'),
25                 'This notification was sent to you because :link cover this type of activity for this item.',
26                 'your notification preferences',
27             ));
28     }
29 }