我们最近将邮件实施切换为基于控制台的。
不幸的是,电子邮件视图中的以下帮助程序代码现在已损坏:
$this->Html->image('file.png', array('fullBase' => true)
虽然我们将CakeEmail的域var设置为正确的值:
$email->domain('www.domain.tld');
助手产生以下
http://home/www/domain.tld/htdocs/img/file.png?1382530379
当前行为: 该文件的资产时间戳只是一个魅力,但不幸的是,我认为由于控制台调用,该文件的UNIX路径为fullBase。
预期行为 fullBaseUrl应该是我们在CakeEmail对象中设置的域。
伙计:除了将域名单独用于$ this-> Html-> image()之外,还有其他可能吗?
答案 0 :(得分:1)
域功能不适用于在资产中配置基本网址,其目的是serve as the host name for the message id。快速查看the code并检查使用$this->_domain
的位置应确认其唯一用途与邮件标题相关。
通过calling Router::fullBaseUrl设置App.fullBaseUrl
的选项:
// inside email-sending command, before sending an email
Router::fullBaseUrl('http://example.com');
或直接配置in core.php:
// anywhere before an email is sent
Configure::write('App.fullBaseUrl', 'http://example.com');