<?php

namespace App\Mail;

use App\Recrutement;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Laravel\Ui\Presets\React;

class RecrutementMail extends Mailable
{
    use Queueable, SerializesModels;
    public $recrutement;

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

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {        
        return $this 
                ->attachFromStorage($this->recrutement->cv, $this->recrutement->nom .'-'.$this->recrutement->prenom )
                ->subject('Recrutement')
                 ->view('mails.recrutement');
    }
}
