带有 Laravel 的邮件降价中的动态基本 link - 不是按钮
Dynamic basic link in mail markdown with Laravel - not a button
我可以像这样生成一个基本的 link:
This is an [example link](http://example.com/).
我可以像这样生成一个带有动态 link 的按钮:
@component('mail::button', ['url' => \URL::to('/subscriptions/'.$recipient->id.'/'.$recipient->email.'?action=subscribe')])
Sign Me Up
@endcomponent
但是如何生成动态 link 而不是按钮?
我试过了:
[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)
您仍在 blade 模板中。因此,如果您不在 blade 指令中并且想要回显内容,则必须使用大括号。
[Safe Unsubscribe]({{ url('/subscriptions/'.$recipient->id.'/'.$recipient->email.'?action=unsubscribe') }})
我可以像这样生成一个基本的 link:
This is an [example link](http://example.com/).
我可以像这样生成一个带有动态 link 的按钮:
@component('mail::button', ['url' => \URL::to('/subscriptions/'.$recipient->id.'/'.$recipient->email.'?action=subscribe')])
Sign Me Up
@endcomponent
但是如何生成动态 link 而不是按钮?
我试过了:
[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)
您仍在 blade 模板中。因此,如果您不在 blade 指令中并且想要回显内容,则必须使用大括号。
[Safe Unsubscribe]({{ url('/subscriptions/'.$recipient->id.'/'.$recipient->email.'?action=unsubscribe') }})