<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class ItineraryMail extends Mailable
{
    use Queueable, SerializesModels;

    public $passenger;
    public $customMessage;
    public $fromEmail;

    /**
     * Create a new message instance.
     */
    public function __construct($passenger, $customMessage, $fromEmail)
    {
        $this->passenger = $passenger;
        $this->customMessage = $customMessage;
        $this->fromEmail = $fromEmail;
    }

    /**
     * Build the message.
     */
public function build()
{
    return $this->from(
            config('mail.from.address'),
            config('mail.from.name')
        )
        ->replyTo($this->fromEmail) // 👈 user Gmail here
        ->subject('View Your Itinerary')
        ->view('emails.itinerary');
}
}
