FounderStartup's avatar

How to test email links on local environment with Mailtrap ?

I need to test the links on local environment with Mailtrap.

For example when I pass a link in the email on Mailtrap it adds the path as mailtrap.io/{ my url }

How can I do it ?

0 likes
6 replies
neilstee's avatar

@solotechpreneur It should work fine, can you try to clear your cache? php artisan config:clear

Also, are you sending this to a running queue? You might need to restart your queue

1 like
FounderStartup's avatar

Still not working.

My controller is :

       'pageurl' => ("/Projectdetails/".$request->projectid."/".$project->slug ),

mail.blade.php

@component('mail::button', ['url' => $respond['pageurl'], 'color' => 'primary'])
Check the project page now
@endcomponent

The final page is

https://mailtrap.io/Projectdetails/1/review-of-abhiman-gardens

No idea where I am getting it wrong ?

Snapey's avatar
Snapey
Best Answer
Level 122

because you don't specify ANY domain in the link, so your browser thinks it is local to the mailtrap site

Create your url with the route helper or the URL class

1 like
FounderStartup's avatar

It worked !!! You are a GURU !! I really appreciate your help. Thank you.

Please or to participate in this conversation.