]> BookStack Code Mirror - bookstack/blobdiff - app/Activity/Notifications/Messages/BaseActivityNotification.php
fix Sidebar scrolling at mid-range sceen
[bookstack] / app / Activity / Notifications / Messages / BaseActivityNotification.php
index eb6eb0cc8fde5f91fc936fc63c8e6bc65006b17e..322df5d94f652b6dbfd4bcb75538cf796af06fb8 100644 (file)
@@ -4,12 +4,12 @@ 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;
 
@@ -19,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.
      *
@@ -52,12 +36,12 @@ abstract class BaseActivityNotification extends Notification
     /**
      * Build the common reason footer line used in mail messages.
      */
-    protected function buildReasonFooterLine(): LinkedMailMessageLine
+    protected function buildReasonFooterLine(LocaleDefinition $locale): LinkedMailMessageLine
     {
         return new LinkedMailMessageLine(
             url('/preferences/notifications'),
-            trans('notifications.footer_reason'),
-            trans('notifications.footer_reason_link'),
+            $locale->trans('notifications.footer_reason'),
+            $locale->trans('notifications.footer_reason_link'),
         );
     }
 }