Akaunting/app/Notifications/Auth/Reset.php

62 lines
1.4 KiB
PHP
Raw Normal View History

2017-09-14 19:21:00 +00:00
<?php
namespace App\Notifications\Auth;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;
class Reset extends Notification
{
/**
* The password reset token.
*
* @var string
*/
public $token;
2025-07-21 12:13:10 +00:00
/**
* The email address.
*
* @var string
*/
public $email;
2017-09-14 19:21:00 +00:00
/**
* Create a notification instance.
*
* @param string $token
2025-07-21 12:13:10 +00:00
* @param string $email
2017-09-14 19:21:00 +00:00
*/
2022-08-18 15:59:00 +00:00
public function __construct($token, $email)
2017-09-14 19:21:00 +00:00
{
$this->token = $token;
2022-08-18 15:59:00 +00:00
$this->email = $email;
2017-09-14 19:21:00 +00:00
}
/**
* Get the notification's channels.
*
* @param mixed $notifiable
* @return array|string
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Build the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
2025-07-21 12:13:10 +00:00
public function toMail($notifiable): MailMessage
2017-09-14 19:21:00 +00:00
{
return (new MailMessage)
2025-07-21 12:13:10 +00:00
->from(config('mail.from.address'), config('mail.from.name'))
2018-05-21 12:26:19 +00:00
->line(trans('auth.notification.message_1'))
2022-08-18 15:59:00 +00:00
->action(trans('auth.notification.button'), route('reset', ['token' => $this->token, 'email' => $this->email]))
2018-05-21 12:26:19 +00:00
->line(trans('auth.notification.message_2'));
2017-09-14 19:21:00 +00:00
}
}