I'm trying to use the Mail Class in Laravel 4, and I'm not able to pass variables to the $m object.
the $team object contains data I grabbed from the DB with eloquent.
Mail::send('emails.report', $data, function($m)
{
$m->to($team->senior->email, $team->senior->first_name. ' '. $team->senior->last_name );
$m->cc($team->junior->email, $team->junior->first_name. ' '. $team->junior->last_name );
$m->subject('Monthly Report');
$m->from('info@website.example', 'Sender');
});
For some reason I get an error where $team object is not available. I suppose it has something to do with the scope.