-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Now forgotten password email also includes token with email
- Loading branch information
ahmadhuss
committed
May 14, 2021
1 parent
bcbeffc
commit 1b1a544
Showing
2 changed files
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,15 +12,18 @@ class AdminResetPasswordNotification extends Notification | |
use Queueable; | ||
|
||
public $token; | ||
public $email; | ||
|
||
/** | ||
* Create a new notification instance. | ||
* | ||
* @return void | ||
* @param $token | ||
* @param null $email | ||
*/ | ||
public function __construct($token) | ||
public function __construct($token, $email = null) | ||
{ | ||
$this->token = $token; | ||
$this->email = $email; | ||
} | ||
|
||
/** | ||
|
@@ -45,9 +48,11 @@ public function toMail($notifiable) | |
// Currently, In our action method: | ||
// The "admin.password.reset" route is the unique route that receiver will receive through email. | ||
// This receive email will contains user email & token. | ||
// route('admin.password.reset', $this->token)) translates into http://localhost/admin/password/reset/033860c11059dcc4c | ||
// route('admin.password.reset', [$this->token, 'email' => $this->email]) translates into http://localhost/admin/password/reset/[email protected] | ||
return (new MailMessage) | ||
->line('You request to reset your password.') | ||
->action('Reset Password Action', route('admin.password.reset', $this->token)) | ||
->action('Reset Password Action', route('admin.password.reset', [$this->token, 'email' => $this->email])) | ||
->line('Thank you for using our application!'); | ||
} | ||
|
||
|