<?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 LineupUserNotificationMail extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(
        public readonly string $title,
        public readonly string $body,
        public readonly array $payload = [],
    ) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'LineUp France - ' . $this->title,
        );
    }

    public function content(): Content
    {
        return new Content(
            view: 'emails.user_notification',
            with: [
                'title' => $this->title,
                'body' => $this->body,
                'payload' => $this->payload,
            ],
        );
    }
}
