<?php

namespace App\Mail;

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

class ChangeWorkOrderVisitStatus extends Mailable
{
    use Queueable, SerializesModels;
	
	public $work_order_visit;
	public $company;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct(WorkOrderVisit $work_order_visit)
    {
        $this->work_order_visit = $work_order_visit;
		$this->company = \Auth::user()->employee->company;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->subject('Work Order Visit')->from($this->company->contacts['email'], $this->company->name)->view('emails.change_work_order_visit_status');
    }
}
