<?php

namespace App\Mail;

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

class CertificateReadyMail extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(public readonly Certificate $certificate) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'Sijil Digital Program — ' . $this->certificate->program->title,
        );
    }

    public function content(): Content
    {
        return new Content(
            view: 'emails.certificate-ready',
        );
    }
}
