]> BookStack Code Mirror - bookstack/blob - app/Activity/Notifications/Messages/PageUpdateNotification.php
Merge pull request #4497 from BookStackApp/notification_language
[bookstack] / app / Activity / Notifications / Messages / PageUpdateNotification.php
1 <?php
2
3 namespace BookStack\Activity\Notifications\Messages;
4
5 use BookStack\Activity\Notifications\MessageParts\ListMessageLine;
6 use BookStack\Entities\Models\Page;
7 use BookStack\Users\Models\User;
8 use Illuminate\Notifications\Messages\MailMessage;
9
10 class PageUpdateNotification extends BaseActivityNotification
11 {
12     public function toMail(User $notifiable): MailMessage
13     {
14         /** @var Page $page */
15         $page = $this->detail;
16
17         $language = $notifiable->getLanguage();
18
19         return $this->newMailMessage($language)
20             ->subject(trans('notifications.updated_page_subject', ['pageName' => $page->getShortName()], $language))
21             ->line(trans('notifications.updated_page_intro', ['appName' => setting('app-name')], $language))
22             ->line(new ListMessageLine([
23                 trans('notifications.detail_page_name', [], $language) => $page->name,
24                 trans('notifications.detail_updated_by', [], $language) => $this->user->name,
25             ]))
26             ->line(trans('notifications.updated_page_debounce', [], $language))
27             ->action(trans('notifications.action_view_page', [], $language), $page->getUrl())
28             ->line($this->buildReasonFooterLine($language));
29     }
30 }