3 namespace BookStack\Activity\Notifications\Messages;
5 use BookStack\Activity\Models\Comment;
6 use BookStack\Activity\Notifications\MessageParts\ListMessageLine;
7 use BookStack\Entities\Models\Page;
8 use Illuminate\Notifications\Messages\MailMessage;
10 class CommentCreationNotification extends BaseActivityNotification
12 public function toMail(mixed $notifiable): MailMessage
14 /** @var Comment $comment */
15 $comment = $this->detail;
16 /** @var Page $page */
17 $page = $comment->entity;
19 return (new MailMessage())
20 ->subject(trans('notifications.new_comment_subject', ['pageName' => $page->getShortName()]))
21 ->line(trans('notifications.new_comment_intro', ['appName' => setting('app-name')]))
22 ->line(new ListMessageLine([
23 trans('notifications.detail_page_name') => $page->name,
24 trans('notifications.detail_commenter') => $this->user->name,
25 trans('notifications.detail_comment') => strip_tags($comment->html),
27 ->action(trans('notifications.action_view_comment'), $page->getUrl('#comment' . $comment->local_id))
28 ->line($this->buildReasonFooterLine());