3 namespace BookStack\Activity\Notifications\Messages;
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;
10 class PageCreationNotification extends BaseActivityNotification
12 public function toMail(User $notifiable): MailMessage
14 /** @var Page $page */
15 $page = $this->detail;
17 $language = $notifiable->getLanguage();
19 return $this->newMailMessage($language)
20 ->subject(trans('notifications.new_page_subject', ['pageName' => $page->getShortName()], $language))
21 ->line(trans('notifications.new_page_intro', ['appName' => setting('app-name')], $language))
22 ->line(new ListMessageLine([
23 trans('notifications.detail_page_name', [], $language) => $page->name,
24 trans('notifications.detail_created_by', [], $language) => $this->user->name,
26 ->action(trans('notifications.action_view_page', [], $language), $page->getUrl())
27 ->line($this->buildReasonFooterLine($language));