<?php

namespace App\Mail;

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

class Contacto extends Mailable
{
    use Queueable, SerializesModels;

    public $form;

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

    /**
     * Build the message.
     *
     * @return $this
     */
     public function build()
     {
         
         return $this->from('no-reply@d11.osole.com.ar', 'Flexoquil mensaje de contacto de ' . $this->form->nombre)
                 ->view('emails.contacto')
                 ->with([
                        'name' => $this->form->name,
                        'nombre' => $this->form->nombre,
                        'email' => $this->form->email,
                        'telefono' => $this->form->telefono,
                        'empresa' => $this->form->empresa,
                        'mensaje' => $this->form->mensaje,
                    ])->attach($this->form->archivo);
     }
}
