我正在尝试在我的 HTML 电子邮件模板中生成链接:
<?php echo $html->link('Find a shop', array('controller' =>'shop', 'action' => 'search'), array('escape'=>false,'target'=>'_blank')); ?>
我希望有一个链接,例如:http://shopexample.localhost/shop-search但只生成了shop-search而没有http://shopexample.localhost
控制器的逻辑是使用 EmailComponent
$this->Email->to = $to;
$this->Email->subject = $subject;
$this->Email->replyTo = $replyTo;
$this->Email->from = "Me <".$from.">";
$this->Email->template = $template;
$this->Email->body = $body;
$this->Email->sendAs = 'html';
$this->Email->smtpOptions = Configure::read('SMTP.Options');
$this->Email->delivery = 'smtp';
if($to!=null){
if($this->Email->send()){
$this->Email->reset();
}
}
包括 HTML 助手。我正在使用 CakePHP 1.3 版。
谢谢