]> BookStack Code Mirror - bookstack/blobdiff - app/Notifications/ConfirmEmail.php
Improve sorting Shelf Books
[bookstack] / app / Notifications / ConfirmEmail.php
index bd310d73de62211744e93bd501150b012dabc66b..229408f5cf9827533a8307727beac5e4768185c7 100644 (file)
@@ -1,13 +1,7 @@
-<?php
+<?php namespace BookStack\Notifications;
 
-namespace BookStack\Notifications;
-
-use Illuminate\Notifications\Notification;
-use Illuminate\Notifications\Messages\MailMessage;
-
-class ConfirmEmail extends Notification
+class ConfirmEmail extends MailNotification
 {
-
     public $token;
 
     /**
@@ -19,17 +13,6 @@ 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.
      *
@@ -38,11 +21,11 @@ class ConfirmEmail extends Notification
      */
     public function toMail($notifiable)
     {
-        return (new MailMessage)
-                    ->subject('Confirm your email on ' . session('app-name'))
-                    ->greeting('Thanks for joining ' . setting('app-name') . '!')
-                    ->line('Please confirm your email address by clicking the button below:')
-                    ->action('Confirm Email', baseUrl('/register/confirm/' . $this->token));
+        $appName = ['appName' => setting('app-name')];
+        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));
     }
-
 }