Skip to content

Instantly share code, notes, and snippets.

@petehouston
Created May 15, 2015 07:39
Show Gist options
  • Save petehouston/9494beda140c30f0d184 to your computer and use it in GitHub Desktop.
Save petehouston/9494beda140c30f0d184 to your computer and use it in GitHub Desktop.
Passing data to queue in Laravel
public function sendUserRegistered($user)
{
$view = 'user_registered';
$data = [
'email' => $user->email,
'name' => $user->name,
'token' => $user->verification->token
];
$this->mail->queue($view, $data , function($message) use ($data)
{
$message->to($user->email, $user->name)->subject('Welcome to the Brotherhood');
});
}
<p> Welcome, {{ $name }} </p>
<p> Hope you like to Brotherhood in Laravel. </p>
<p> Best Regards </p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment