]> BookStack Code Mirror - bookstack/blob - app/Notifications/ResetPassword.php
Merge remote-tracking branch 'upstream/master'
[bookstack] / app / Notifications / ResetPassword.php
1 <?php
2
3 namespace BookStack\Notifications;
4
5 use Illuminate\Notifications\Notification;
6 use Illuminate\Notifications\Messages\MailMessage;
7
8 class ResetPassword extends Notification
9 {
10     /**
11      * The password reset token.
12      *
13      * @var string
14      */
15     public $token;
16
17     /**
18      * Create a notification instance.
19      *
20      * @param  string  $token
21      */
22     public function __construct($token)
23     {
24         $this->token = $token;
25     }
26
27     /**
28      * Get the notification's channels.
29      *
30      * @param  mixed  $notifiable
31      * @return array|string
32      */
33     public function via($notifiable)
34     {
35         return ['mail'];
36     }
37
38     /**
39      * Build the mail representation of the notification.
40      *
41      * @return \Illuminate\Notifications\Messages\MailMessage
42      */
43     public function toMail()
44     {
45         return (new MailMessage)
46             ->subject(trans('auth.email_reset_subject', ['appName' => setting('app-name')]))
47             ->line(trans('auth.email_reset_text'))
48             ->action(trans('auth.reset_password'), baseUrl('password/reset/' . $this->token))
49             ->line(trans('auth.email_reset_not_requested'));
50     }
51 }