Skip to content

Instantly share code, notes, and snippets.

@petehouston
Created May 15, 2015 07:29
Show Gist options
  • Save petehouston/aaafe23f9b38c1b67142 to your computer and use it in GitHub Desktop.
Save petehouston/aaafe23f9b38c1b67142 to your computer and use it in GitHub Desktop.
Passing data synchronously from queue in laravel
/**
* The mailer contract
*
* @var Illuminate\Contracts\Mail\Mailer
*/
protected $mail;
public function sendUserRegistered($user)
{
$view = 'user_registered';
$this->mail->send($view, $user , function($message) use ($user)
{
$message->to($user->email, $user->name)->subject('Welcome to the Brotherhood!');
});
}
<p>Welcome, {{ $user->name }}</p>
<p>Hope you like the 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