Laravel 4.2 Email ::有资产的队列 [英] Laravel 4.2 Email::queue with assets

查看:92
本文介绍了Laravel 4.2 Email ::有资产的队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单,我正在尝试使用beantalked和supervised服务将电子邮件排入队列,

Simple, I am trying to queue an email using services beanstalkd and supervisord like so:

Mail::queue('emails.congratulations', $user, function($message) use($user) {
    $message->to($user['email'], $user['name'])
        ->subject('Congratulations!');
});

我的主管程序配置:

[program:emailservice]
command=php /path/to/laravel/artisan queue:listen
stdout_logfile=/path/to/laravel/app/storage/logs/emailservice_supervisord.log
redirect_stderr=true

在我的刀片文件中,我试图访问资产(图像):

In my blade file I am trying to access an asset, an image:

<p>
    <img src="{{ asset('assets/img/logo.png') }}" />
</p>

发送和接收电子邮件时,图像损坏,并且图像的URL如下所示:

When the email is sent and received, the image is broken and the URL to the image looks like this:

<img src="http://:/assets/img/logo.png"/>

我不知道为什么域是:

如果其他人有这种行为,最好公开进行,因为我一直在Google和StackOverflow上搜索该问题的答案,而没有提及该问题.

If anyone else as experienced this behavior it would be good to get this out in the open because I have scoured Google and StackOverflow for answers to this issue without any mention of the issue.

我问自己一个问题...排队时,Laravel/主管/Beanstalk是否足够聪明,可以记住工作的领域?

A question I ask myself... when queuing, is Laravel/Supervisor/Beanstalk smart enough to remember the domain for the job?

推荐答案

您必须在config/app.php中将应用程序URL设置为您的域(默认为http://localhost).

You have to set application url to your domain (http://localhost by default) in config/app.php.

这篇关于Laravel 4.2 Email ::有资产的队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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