<?php

namespace App\Mail;

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

class ServiceConfigurationInternal extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(public Inquiry $inquiry, public array $configurator) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            replyTo: [new Address($this->inquiry->email, $this->inquiry->name)],
            subject: 'Neue '.$this->configurator['label'].'-Konfiguration von '.$this->inquiry->name,
        );
    }

    public function content(): Content
    {
        return new Content(view: 'emails.service-configuration-internal');
    }
}
