Laravel队列(iron.io)不断发送同一封电子邮件

时间:2015-11-02 09:57:27

标签: php laravel laravel-5

我在Laravel 5.1中使用Iron.io API。它发送的电子邮件很好。但是,它似乎一遍又一遍地发送相同的消息(4次或更多次)。知道为什么会这样吗?

我使用的代码是:

Mail::queue([], [], function ($message) use ($template, $order, $filename) {
    $message
    ->to($order->email)
    ->subject($template->subject)
    ->setBody(DbView::make($template)->with($order->toArray())->render(), 'text/html');

    $message->attach(storage_path('exports/'.$filename));
});

1 个答案:

答案 0 :(得分:0)

Ben击中了头部的钉子。

如果它很方便,这里有一个指向Iron.io开发人员文档的链接:

  

此调用获取/保留队列中的消息。消息不会被删除,但会在超时到期之前保留。如果超时在消息被删除之前到期,则消息将被放回队列中。因此,请务必在完成后删除这些消息。

http://dev.iron.io/mq/reference/api/#get_messages_from_a_queue

相关问题