<?php

namespace App\Mail;

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

class ResponseMail extends Mailable
{
    use Queueable, SerializesModels;

    public $response;
    public $pdfPath;

    public function __construct($response, $pdfPath)
    {
        $this->response = $response;
        $this->pdfPath = $pdfPath;
    }

    public function build()
    {
        return $this->subject('Votre réponse')
                    ->view('emails.response')
                    ->attach($this->pdfPath, [
                        'as' => 'response.pdf',
                        'mime' => 'application/pdf',
                    ]);
    }
}
