X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/9779c1a357d49654856ceb1b1f30d91cde8fa2fd..refs/pull/4562/head:/app/Activity/Notifications/Messages/BaseActivityNotification.php diff --git a/app/Activity/Notifications/Messages/BaseActivityNotification.php b/app/Activity/Notifications/Messages/BaseActivityNotification.php index 285e2803e..322df5d94 100644 --- a/app/Activity/Notifications/Messages/BaseActivityNotification.php +++ b/app/Activity/Notifications/Messages/BaseActivityNotification.php @@ -3,12 +3,13 @@ namespace BookStack\Activity\Notifications\Messages; use BookStack\Activity\Models\Loggable; +use BookStack\Activity\Notifications\MessageParts\LinkedMailMessageLine; +use BookStack\App\MailNotification; +use BookStack\Translation\LocaleDefinition; use BookStack\Users\Models\User; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Messages\MailMessage; -use Illuminate\Notifications\Notification; -abstract class BaseActivityNotification extends Notification +abstract class BaseActivityNotification extends MailNotification { use Queueable; @@ -18,22 +19,6 @@ abstract class BaseActivityNotification extends Notification ) { } - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * @return array - */ - public function via($notifiable) - { - return ['mail']; - } - - /** - * Get the mail representation of the notification. - */ - abstract public function toMail(mixed $notifiable): MailMessage; - /** * Get the array representation of the notification. * @@ -47,4 +32,16 @@ abstract class BaseActivityNotification extends Notification 'activity_creator' => $this->user, ]; } + + /** + * Build the common reason footer line used in mail messages. + */ + protected function buildReasonFooterLine(LocaleDefinition $locale): LinkedMailMessageLine + { + return new LinkedMailMessageLine( + url('/https/source.bookstackapp.com/preferences/notifications'), + $locale->trans('notifications.footer_reason'), + $locale->trans('notifications.footer_reason_link'), + ); + } }