<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Address;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class OfferPublished extends Mailable
{
    use Queueable, SerializesModels;
    public $user;
    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($user, $offre)
    {
        $this->user = $user;   
        $this->offre = $offre;
    }
    public function build()
    {
        return $this->view('emails.offer_published')
                    ->subject('Nouvelle offre disponible pour votre filière')
                    ->with([
                        'userName' => $this->user->name,
                        'filiereName' => $this->user->filiere->name,
                        'offreTitle' => $this->offre->title,
                    ]);
    }

    

    
}
