<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class OtpMail extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(public readonly string $code, public readonly string $purpose) {}

    public function envelope(): Envelope
    {
        return new Envelope(subject: 'Your verification code');
    }

    public function content(): Content
    {
        return new Content(markdown: 'emails.otp', with: ['code' => $this->code, 'purpose' => $this->purpose]);
    }
}
