<?php

namespace App\Mail;

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

    public function __construct(
        public string $nama,
        public string $email,
        public string $usaha,
        public string $pesan,
    ) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'Dukungan Aplikasi CASHEV - ' . $this->nama,
            replyTo: [new Address($this->email, $this->nama)],
        );
    }

    public function content(): Content
    {
        return new Content(
            markdown: 'emails.contact',
            with: [
                'nama'  => $this->nama,
                'email' => $this->email,
                'usaha' => $this->usaha,
                'pesan' => $this->pesan,
            ],
        );
    }
}
