<?php

namespace Modules\Deal\Mails;

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

class ChangeStatusMail extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct(
        public $data,
        public $view,
        public $subject
    ){}

    public function build()
    {
        $address = 'notification.crm@skybridgeworld.com';
        $name = 'SkyBridge CRM';
        
        return $this->view($this->view)
                    ->from($address, $name)
                    ->replyTo($address, $name)
                    ->subject($this->subject)
                    ->with([ 'deal' => $this->data ]);
    }
}