在Iron.io中使用Mail :: queue [英] Using Mail::queue with iron.io

查看:55
本文介绍了在Iron.io中使用Mail :: queue的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Laravel 4中使用 Mail :: queue ,但没有成功.

I'm trying to use the Mail::queue in Laravel 4 without success.

当我运行命令时:

php artisan queue: subscribe queue_name http://foo.com/queue/push

它是在我的仪表板上创建的一个订阅者,并且当我访问路由排队/发送时,一个新队列也会发送到Iron.io.

It is created on my dashboard a subscriber, and also when I access my route queue/send a new queue is sent to Iron.io.

问题在于,在执行 Mail :: queue 时应发送 我从未收到电子邮件 .

The problem is that I never received the email should be sent when the Mail::queue to be executed.

看我的路线:

<?php
Route::post('queue/push', function() {
        return Queue::marshal();
    });

Route::get('queue/send', function() {
        Mail::queue('emails.teste', array(), function($message) {
                    $message->to('me@mesite.com', 'Renato')->subject('Welcome!');
                });

        return 'Ok';
    });

除了queues.php之外,是否还有其他需要配置的东西?

Is there any configuration beyond queues.php I need to do?

当我将队列/推送(用于调试)更改为接受GET并访问URL时,出现以下错误:

When I change the queue/push (for debug) to accept GET and access the URL, the following error appears:

lluminate \ Encryption \ DecryptException

lluminate\Encryption\DecryptException

无效的数据.

推荐答案

我可能已关闭,但是Mail::send()是要使用的正确函数,因为您正在使用Iron.io来处理队列.

I might be off, but Mail::send() is the correct function to use, since you are using Iron.io to handle the queue.

这应该有效:

Route::get('queue/send', function() {

    Queue::push(function($job) {

        Mail::send('emails.teste', array(), function($message) {
            $message->to('me@mesite.com', 'Renato')->subject('Welcome!');
        });

        $job->delete();
    }

    return 'Ok';
});

我还建议检查您的Iron.io帐户,以确保正确设置了订户" URL.正如Rob W所建议的那样,该空间可能会引起问题.

I'd also suggest checking your Iron.io account to ensure that the 'subscriber' URL is set-up correctly. As Rob W suggests, the space could be causing issues.

这篇关于在Iron.io中使用Mail :: queue的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆