如何在不执行php artisan队列的情况下发送带队列的邮件:listen?

时间:2017-03-25 13:16:47

标签: php laravel email terminal queue

我在orderController中有一个函数,它向所有卖家发送有关新订单的电子邮件:

public function sendMailToSellers($order, $orderDetails)
    {

        $sellers = Role::with('users')->where('name', 'seller')->get()->first()->users->toArray();
        $emails = [];
        foreach ($sellers as $seller) {
            $emails[] = $seller['email'];
        }


        Mail::queue(green.'.orderEmail', ['order_details' => $orderDetails, 'order' => $order], function ($message) use ($emails, $order) {
            $message->from('myMail@gmail.com', 'MyShop');
            $message->bcc($emails);
            $message->subject('New order №' . $order['order_id'].' '. $order['created_at']);
        });

    }

但问题是只有当我在终端php artisan队列中运行时才发送电子邮件:listen。我试图运行nohup php artisan队列:listen,但终端告诉我nohup不存在:c。

0 个答案:

没有答案