I promise this is not just another Mail::queue newbie question. I had Laravel 4.2 app working with Iron.io Push queues Then, I upgraded to Laravel 5.1 and my Mails just stopped working. I have UserController from which I send user account verification email to the registrant.
//Used for Mail
$data=['msg'=>$msg];
$details=array(
'email'=>$email,
'name'=>$name,
'subject'=>$subject,
'msg'=>$msg);
\Mail::queue(['text'=>'emails.contactus'],$data,
function($message) use ($email,$name,$subject) {
$message->from($email,$name);
$message->to(Config::get('app.site_support'))->subject($subject);
});
Iron.io is configured properly with keys and such. My Mail queuing app and queue processing apps are different.
Error I get is
[2015-10-19 18:12:32] production.INFO: Queue POST Item received
[2015-10-19 18:12:32] production.ERROR: exception 'ErrorException' with message 'Class 'UserController' not found' in /var/www/app/vendor/jeremeamia/SuperClosure/src/SerializableClosure.php:130
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'Class 'UserCont...', '/var/www/app...', 130, Array)
#1 /var/www/app/vendor/jeremeamia/SuperClosure/src/SerializableClosure.php(130): Closure->bindTo(NULL, 'UserController')
#2 [internal function]: SuperClosure\SerializableClosure->unserialize('a:5:{s:4:"code"...')
#3 /var/www/app/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(300): unserialize('C:32:"SuperClos...')
#4 /var/www/app/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(286): Illuminate\Mail\Mailer->getQueuedCallable(Array)
Looks like Mail::queue is serializing UserControl which is not available in queue/receive processor app. I tried placing UserController in processor app but still get the same error