<?php
namespace App\Mail;

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

class SampleMail extends Mailable
{
    use Queueable, SerializesModels;

    public $offer;
    public $pdf;

    /**
     * Create a new message instance.
     *
     * @param mixed $offer The offer data you want to pass
     */
    public function __construct($offer, $pdf)
    {
        $this->offer = $offer;
        $this->pdf = $pdf;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->subject('OFFER LETTER')
            ->attachData($this->pdf->output(), 'offer_letter.pdf')
            ->view('pdf.offer-message');
    }
}
