Logo link in transaction emails
When my app sends transactional emails like verification emails, the logo appears correctly at the top, but it links to the root path (/) instead of my actual website. To fix this, I edited the email template and updated the link around the logo. Originally, the logo was wrapped in an anchor tag pointing to /, which caused the redirection issue. I changed the href attribute to my full website URL (e.g., https://mywebsite.com) so that now, when users click on the logo in the email, they’re taken directly to my homepage. If you’re using an email service provider like SendGrid or Mailgun, you can usually update this in their template editor. Always test after making changes to ensure everything works as expected.
Where is the email template found? Which file?
And how would you update this in sendgrid or mailgun if the template is being generated from Laravel itself? These templates don’t appear there, they are just used for sending through the SMTP server, no?
This kind of sounds like an AI generated answer that doesn’t actually address the specifics of the question.
Hey!
I think that it is just picked up from the APP_URL
env var:
-
Set
APP_URL
in your.env
file to your website URL, like:APP_URL=https://yourdomain.com
-
Then run:
php artisan config:clear
This will update the logo link in all system emails.
If you want full control, you can publish the mail templates with:
php artisan vendor:publish --tag=laravel-mail
And edit the logo link in resources/views/vendor/mail/html/header.blade.php
or modify the mail templates as you need.
- Bobby
My APP_URL was already set to my website URL. I ran php artisan config:clear
and tried to resend a transaction email. The link was still blank. I then ran php artisan vendor:publish --tag=laravel-mail
and opened resources/views/vendor/mail/html/header.blade.php
and it only contains this:
<x-auth::elements.logo
:height="config('devdojo.auth.appearance.logo.height')"
:isImage="(config('devdojo.auth.appearance.logo.type') == 'image')"
:imageSrc="config('devdojo.auth.appearance.logo.image_src')"
:svgString="config('devdojo.auth.appearance.logo.svg_string')"
/>
I don't see anywhere to edit the logo link.
This is the content of vendor/devdojo/auth/resources/views/components/elements/logo.blade.php
:
<a href="/" style="height:{{ $height ?? '30' }}px; width:auto; display:block" aria-label="{{ config('app.name') }} Logo">
@if($isImage)
<img src="{{ url($imageSrc) }}" style="height:100%; width:auto" alt="" />
@else
{!! str_replace('<svg', '<svg style="height:100%; width:auto"', $svgString) !!}
@endif
</a>
Certainly this is the cause of the issue. I'd prefer not to modify vendor files, so perhaps the appropriate changes can be implemented in the auth package?
Good point. I've submitted a PR for this:
Also, the auth package is open source, so if there's ever something you'd like to tweak or improve, you're more than welcome to submit a PR too!















