]> BookStack Code Mirror - bookstack/blobdiff - app/Notifications/ConfirmEmail.php
Updated minimum php version from 7.3 to 7.4
[bookstack] / app / Notifications / ConfirmEmail.php
index 64d9bb9acb6494ebf3c0db1b6e884e34b9d86d99..5399c25a8492eca5bdbfd52236c439630e02d45c 100644 (file)
@@ -2,16 +2,13 @@
 
 namespace BookStack\Notifications;
 
-use Illuminate\Notifications\Notification;
-use Illuminate\Notifications\Messages\MailMessage;
-
-class ConfirmEmail extends Notification
+class ConfirmEmail extends MailNotification
 {
-
     public $token;
 
     /**
      * Create a new notification instance.
+     *
      * @param string $token
      */
     public function __construct($token)
@@ -19,31 +16,21 @@ class ConfirmEmail extends Notification
         $this->token = $token;
     }
 
-    /**
-     * Get the notification's delivery channels.
-     *
-     * @param  mixed  $notifiable
-     * @return array
-     */
-    public function via($notifiable)
-    {
-        return ['mail'];
-    }
-
     /**
      * Get the mail representation of the notification.
      *
-     * @param  mixed  $notifiable
+     * @param mixed $notifiable
+     *
      * @return \Illuminate\Notifications\Messages\MailMessage
      */
     public function toMail($notifiable)
     {
         $appName = ['appName' => setting('app-name')];
-        return (new MailMessage)
-                    ->subject(trans('auth.email_confirm_subject', $appName))
-                    ->greeting(trans('auth.email_confirm_greeting', $appName))
-                    ->line(trans('auth.email_confirm_text'))
-                    ->action(trans('auth.email_confirm_action'), baseUrl('/register/confirm/' . $this->token));
-    }
 
+        return $this->newMailMessage()
+                ->subject(trans('auth.email_confirm_subject', $appName))
+                ->greeting(trans('auth.email_confirm_greeting', $appName))
+                ->line(trans('auth.email_confirm_text'))
+                ->action(trans('auth.email_confirm_action'), url('/register/confirm/' . $this->token));
+    }
 }