Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mail::queue causes an error #1985

Closed
benperiton opened this issue Jul 31, 2013 · 7 comments
Closed

Mail::queue causes an error #1985

benperiton opened this issue Jul 31, 2013 · 7 comments

Comments

@benperiton
Copy link
Contributor

I have configured my app to use a beanstalkd queue, and it works just fine for custom job handlers, but if I use Mail::queue then it causes the following error:

Unhandled exception: syntax error, unexpected ';'
/var/www/api/vendor/laravel/framework/src/Illuminate/Support/SerializableClosure.php(173) : eval()'d code on line 3
#0 [internal function]: Illuminate\Exception\Handler->handleShutdown()
#1 {main} [] []

The calling code in the controller is:
Mail::queue('emails.order-new', array(), function ($message) {
$message->to('myemail@local', 'Fname Lname')->subject('Order Received');
});

If I log the $payload['code'] in SerializableClosure.php it outputs:
Mail::queue('emails.order-new', array(), function ($message) {
$message->to('myemail@local', 'Fname Lname')->subject('Order Received');
}

It looks like it is missing the final ')'

@taylorotwell
Copy link
Member

Grab the code directly from your controller and paste it into paste.laravel.com

@benperiton
Copy link
Contributor Author

Sure, http://paste.laravel.com/FqA

@taylorotwell
Copy link
Member

Hmm, I don't know that this will fix but just for kicks can you move the opening brace of your Closure onto its own line?

@benperiton
Copy link
Contributor Author

No joy Im afraid - just for the fun of it I also tried removing all spaces, tabs etc, various combinations of line breaks but no go

@lucacri
Copy link
Contributor

lucacri commented Aug 10, 2013

I'm having the same issue, i think:
http://paste.laravel.com/Ihh

@binarix
Copy link

binarix commented Aug 12, 2013

Try http://paste.laravel.com/IPs

Remove the space between function and ($message) make it read function($message)

@taylorotwell
Copy link
Member

This should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants