Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 13 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| ResetPassword | |
0.00% |
0 / 13 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| via | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| toMail | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Notifications\Business; |
| 4 | |
| 5 | use Illuminate\Notifications\Messages\MailMessage; |
| 6 | use Illuminate\Notifications\Notification; |
| 7 | use Illuminate\Support\Facades\Config; |
| 8 | use Illuminate\Support\Facades\Lang; |
| 9 | |
| 10 | class ResetPassword extends Notification |
| 11 | { |
| 12 | public $token; |
| 13 | public string $frontendBaseUrl; |
| 14 | |
| 15 | public function __construct($token) |
| 16 | { |
| 17 | $this->frontendBaseUrl = config('romeo.frontend-base-url'); |
| 18 | $this->token = $token; |
| 19 | } |
| 20 | |
| 21 | public function via($notifiable): array |
| 22 | { |
| 23 | return ['mail']; |
| 24 | } |
| 25 | |
| 26 | public function toMail($notifiable): MailMessage |
| 27 | { |
| 28 | $url = request()->request->get('referer').'?'. |
| 29 | 'email='.$notifiable->getEmailForPasswordReset().'&'. |
| 30 | 'token='.$this->token; |
| 31 | |
| 32 | return (new MailMessage) |
| 33 | ->bcc(config('hubspotconfig.bcc_email')) |
| 34 | ->subject(Lang::get('Out with the old and in with the new')) |
| 35 | ->view('mail.business.reset', [ |
| 36 | 'name' => $notifiable->first_name, |
| 37 | 'url' => $url, |
| 38 | ]); |
| 39 | } |
| 40 | } |