]> BookStack Code Mirror - bookstack/blobdiff - app/Notifications/ResetPassword.php
Added testing coverage for tag index
[bookstack] / app / Notifications / ResetPassword.php
index 646030a103f6f9ff648d602753ce807147ca91ca..7fa14659604f567ec04847ee761526c1dfdf2b0f 100644 (file)
@@ -2,10 +2,7 @@
 
 namespace BookStack\Notifications;
 
-use Illuminate\Notifications\Notification;
-use Illuminate\Notifications\Messages\MailMessage;
-
-class ResetPassword extends Notification
+class ResetPassword extends MailNotification
 {
     /**
      * The password reset token.
@@ -17,24 +14,13 @@ class ResetPassword extends Notification
     /**
      * Create a notification instance.
      *
-     * @param  string  $token
+     * @param string $token
      */
     public function __construct($token)
     {
         $this->token = $token;
     }
 
-    /**
-     * Get the notification's channels.
-     *
-     * @param  mixed  $notifiable
-     * @return array|string
-     */
-    public function via($notifiable)
-    {
-        return ['mail'];
-    }
-
     /**
      * Build the mail representation of the notification.
      *
@@ -42,9 +28,10 @@ class ResetPassword extends Notification
      */
     public function toMail()
     {
-        return (new MailMessage)
-            ->line('You are receiving this email because we received a password reset request for your account.')
-            ->action('Reset Password', baseUrl('password/reset/' . $this->token))
-            ->line('If you did not request a password reset, no further action is required.');
+        return $this->newMailMessage()
+            ->subject(trans('auth.email_reset_subject', ['appName' => setting('app-name')]))
+            ->line(trans('auth.email_reset_text'))
+            ->action(trans('auth.reset_password'), url('password/reset/' . $this->token))
+            ->line(trans('auth.email_reset_not_requested'));
     }
 }