41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Mail\Customer;
|
|
|
|
use App\Mail\Concerns\RequiresDbTemplate;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class PasswordResetLink extends Mailable
|
|
{
|
|
use Queueable, SerializesModels, RequiresDbTemplate;
|
|
|
|
public function __construct(public array $data) {}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: $this->renderFromTemplate('customer_password_reset_link', $this->vars())['subject'],
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
htmlString: $this->renderFromTemplate('customer_password_reset_link', $this->vars())['html'],
|
|
);
|
|
}
|
|
|
|
private function vars(): array
|
|
{
|
|
return [
|
|
'full_name' => $this->data['fullname'] ?? 'Quý khách',
|
|
'reset_url' => $this->data['reset_url'] ?? '',
|
|
'expire_minutes' => (string) config('auth.passwords.users.expire', 60),
|
|
];
|
|
}
|
|
}
|