<?php

namespace App\Mail;

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

class InquiryMail extends Mailable
{
    use Queueable, SerializesModels;

    public $inquiryData;

    /**
     * Create a new message instance.
     *
     * @param  array  $inquiryData
     * @return void
     */
    public function __construct($inquiryData)
    {
        $this->inquiryData = $inquiryData;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->subject('新的询盘邮件') // 设置邮件主题
        ->view('emails.inquiry') // 指定视图文件
        ->with(
         $this->inquiryData, // 传递数据到视图
        );
    }
}
