<?php

namespace App\Mail;

use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class PasswordRecovered extends Mailable implements ShouldQueue {
    use Queueable, SerializesModels;

    public User $recipient;
    public string $password;

    public function __construct(User $recipient, string $password) {
        $this->recipient = $recipient;
        $this->password = $password;
    }

    public function build(): PasswordRecovered {
        return $this->subject('Пароль сброшен')->view('mail.user.password-recovered');
    }
}
