mercredi 28 septembre 2016

Pass variable throug Mail::send layout in Laravel 5

So I don't understand how to pass variable to my layout.

Actually i'm using

    Mail::send('emails.aLaCarteMail', $data, function($message) use ($user) {
        $message->from('wtv@wtv.com', 'Agence de Voyage');
        $message->to($user['email'], $user['name'])->subject('Demande : Voyage à la carte ['.$user['email'].']');
        return "true";
    });

$data being an array like :

    $data = array(
        'prenom'=> $prenom,
        'nom'=> $nom,
        'email'=> $email,
         ...
    );

So my mail is sent with the right template but without the variable like or which are let as blank.

Can someone highlight me what am I missing ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire