<?php

namespace App\Mail\SelfPaced;

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

class SelfPacedPaymentProofApprovedMail extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(public PaymentProof $proof) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'Payment Verified — ' . $this->proof->course->title,
        );
    }

    public function content(): Content
    {
        return new Content(
            view: 'emails.self-paced.proof-approved',
            with: [
                'proof' => $this->proof,
                'learner' => $this->proof->user,
                'course' => $this->proof->course,
            ],
        );
    }
}
