<?php

namespace App\Mail;

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

class NouvelleSoumission extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(public Soumission $soumission) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'Nouvelle demande de contact — '.$this->soumission->sub_prenom.' '.$this->soumission->sub_nom,
        );
    }

    public function content(): Content
    {
        return new Content(view: 'emails.nouvelle-soumission');
    }
}
