Laravel邮件降价中的动态基本链接-不是按钮

时间:2018-11-22 15:41:03

标签: laravel markdown html-email laravel-5.7

我可以像这样生成一个基本链接:

This is an [example link](http://example.com/).

我可以生成带有动态链接的按钮,如下所示:

@component('mail::button', ['url' => \URL::to('/subscriptions/'.$recipient->id.'/'.$recipient->email.'?action=subscribe')])
Sign Me Up
@endcomponent

但是如何生成动态链接而不是按钮?

我尝试过:

[Safe Unsubscribe]( url('/subscriptions/'.$recipient->id.'/'.$recipient->email.'?action=unsubscribe') )

[Safe Unsubscribe]( \URL::to('/subscriptions/'.$recipient->id.'/'.$recipient->email.'?action=unsubscribe') )

但这些输出以字面方式显示:

url('/subscriptions/'.%24recipient-%3Eid.'/'.%24recipient-%3Eemail.'?action=subscribe%27)

1 个答案:

答案 0 :(得分:2)

您仍在刀片服务器模板中。因此,如果您不在Blade指令中,并且想要回显内容,则必须使用大括号。

[Safe Unsubscribe]({{ url('/subscriptions/'.$recipient->id.'/'.$recipient->email.'?action=unsubscribe') }})