<?php

namespace App\Mail;

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

class ContactNotifyMail extends Mailable {
  use Queueable, SerializesModels;
  private $form;
  private $file;

  public function __construct ($form, $file) {
    $this->form = $form;
    $this->file = $file;
  }

  public function build () {
    return $this->from($this->form['adr'])->subject($this->form['kenmei'])->markdown('emails.notify.contact', ['form' => $this->form])->attachFromStorage('public/'.$this->file);
  }
}
