<?php

namespace App\Mail;

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

class SupportRequestAlert extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(
        public readonly SupportRequest $supportRequest,
    ) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            from:    config('services.support.from'),
            subject: __('mail.support_request.subject', ['title' => $this->supportRequest->title]),
        );
    }

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

    public function attachments(): array
    {
        return [];
    }
}
