loic-sharma / Messages

A Laravel Bundle for the Swiftmailer library
GNU Lesser General Public License v3.0
39 stars 7 forks source link

Pass some variables to send function callback #22

Closed yukulelix closed 11 years ago

yukulelix commented 11 years ago

Hi, how would you pass an email variable to the callback of send function ? For instance :

Message::send(function($message)
{
    $message->to($email);
});

Thanks in advance !

loic-sharma commented 11 years ago

Look up use for anonymous functions:

function($message) use($email)
{
    // ...
}