<?php

namespace App\Mail;

use App\Models\FosteringApplication;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class FosteringApplicationReceived extends Mailable implements ShouldQueue
{
    use Queueable;
    use SerializesModels;

    public function __construct(public FosteringApplication $application) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'Fostering Application Received',
        );
    }

    public function content(): Content
    {
        return new Content(
            markdown: 'emails.fostering-application-received',
            with: [
                'application' => $this->application,
                'applicant' => $this->application->user,
            ],
        );
    }
}
