我正在尝试在 Laravel 5.2 中对电子邮件进行排队,但我一直在数据库中收到空负载(如下所示)
我的config\queue.php
'connections' => [
...
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'expire' => 60,
],
...
]
我的排队代码:
if(Input::get('email-admin')) {
$admin_pdf = PDF::loadView('emails.reporting.checkin-report', ['content' => $admin_email])->inline();
Mail::queue('emails.reporting.checkin-email', [], function ($m) use ($admin_pdf, $start) {
//Admin should have User ID of '1'
$admin = User::find(1);
$report_name = $start->format('F') . '-report.pdf';
$m->attachData($admin_pdf, $report_name);
$m->to($admin->email, $admin->first_name)->subject('flexxifit ' . $start->format('F') . ' Report');
});
}
我也试过 Mail::later()
但没有成功。
最佳答案
关于php - Laravel 5 邮件队列不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38736557/