Email 电子邮件内容中的链接如何与cakephp3协同工作

Email 电子邮件内容中的链接如何与cakephp3协同工作,email,hyperlink,cakephp-3.0,Email,Hyperlink,Cakephp 3.0,我希望用户在点击电子邮件中的链接时激活他的帐户,我的问题是链接不起作用 我的用户控制器 if ($this->Users->save($user)) { $email = new Email(); $email->transport('mailjet') ->to('xxxxxxx@gmail.com') ->templat

我希望用户在点击电子邮件中的链接时激活他的帐户,我的问题是链接不起作用

我的用户控制器

if ($this->Users->save($user)) {
                $email = new Email();
                $email->transport('mailjet')
                    ->to('xxxxxxx@gmail.com')
                    ->template('add')
                    ->emailFormat('html')
                    ->viewVars(['nom' =>$user['first_name'],
                        'url'=>['controller'=>'users','action'=>'active',$user],
                         'user'=>$user])
                    ->subject('fffff')
                    ->send();
函数激活($user)代码

模板/Email/html/add.ctp

<?php 
use Cake\Routing\Router; 
use Cake\Routing;
?>
    <strong>Bonjour <?php echo $nom ?></strong>
    <p >Pour activer ce compte suivez le lien </p>
    <?php echo $this->Html->link('Activer mon compte',Router::url($url, true), ['escape' => false]);?></p>`

你好
Pour activer ce compte suivez le lien

`

调用url结构时出现的问题错误链接重定向时出错。我们的团队已经收到通知,将检查此问题。如果有效,我将函数active($user)更改为active($id=null)
<?php 
use Cake\Routing\Router; 
use Cake\Routing;
?>
    <strong>Bonjour <?php echo $nom ?></strong>
    <p >Pour activer ce compte suivez le lien </p>
    <?php echo $this->Html->link('Activer mon compte',Router::url($url, true), ['escape' => false]);?></p>`