<?php

namespace App\Mail;

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

class NewUserWelcomeMail extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(public User $user, public string $password) {}

    public function build(): self
    {
        return $this->subject('Welcome to FMP CORE — Your Account Details')
            ->view('emails.new-user')
            ->with([
                'name'     => $this->user->name,
                'email'    => $this->user->email,
                'password' => $this->password,
            ]);
    }
}
