<?php

namespace App\Mail;

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

class NotificationMail extends Mailable
{
    use Queueable, SerializesModels;

    public $emailData;

    public function __construct($emailData)
    {
        $this->emailData = $emailData;
    }

    public function build()
    {
        return $this->from($this->emailData['sent_from'], $this->emailData['sender'])
                    ->subject($this->emailData['subject'])
                    ->view('emails.notification')
                    ->with('emailData', $this->emailData);
    }
}
