X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/fff5bbcee458992443e3732fbcbbbe34f765fcc3..refs/pull/3245/head:/app/Notifications/ResetPassword.php diff --git a/app/Notifications/ResetPassword.php b/app/Notifications/ResetPassword.php index 646030a10..7fa146596 100644 --- a/app/Notifications/ResetPassword.php +++ b/app/Notifications/ResetPassword.php @@ -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')); } }