0
votes

I send mail with Laravel:

Mail\User.php

return $this->from('[email protected]', 'Admin')
        ->subject('Register in example')
        ->markdown('mails.user')
        ->with([
            'name' => 'Register in example',
            'link' => $link,
        ]);

mails\user.blade.php

@component('mail::message')

Link:
<a href="{{$link}}">{{$link}}</a>
@endcomponent

Message arrives in the inbox:

Link:
<a href="http://...">http://...</a>

Only on gmail, when I enter a regular link it works, i.e.

mails\user.blade.php

@component('mail::message')

Link:
{{$link}}
@endcomponent

After first line Laravel creates tag. I don't know why, I write text in the same tag @component('mail::message'):

@component('mail::message')
**Hi**,



Twój indywidualny link do sprawdzania udziałów:
    [{{$linkActivation}}]({{$linkActivation}})

@endcomponent

"Hi" works, but link not. In inbox sth like:

<p>Hi</p>
<pre><code>rest of the text</code></pre>
2
What's your question?Joundill
How to send clicable link?xbiu
And what's not working?Joundill
Message arrives in the inbox with <a> tag as textxbiu
Did my answer work?Joundill

2 Answers

0
votes

You're using markdown not HTML in your Mail\User.php: ->markdown('mails.user')

You need to use markdown syntax to send a link, [link text](URL)