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

    public function __construct(public Inquiry $inquiry) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            replyTo: [new Address($this->inquiry->email, trim($this->inquiry->first_name.' '.$this->inquiry->name))],
            subject: 'Neuer Schnellkontakt von '.trim($this->inquiry->first_name.' '.$this->inquiry->name),
        );
    }

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