Vyshnia liked a comment+100 XP
2mos ago
Hi!
I am trying to send emails with Laravel, and sending the email is working. I have a couple of stylesheets and images that are referenced using asset(). Problem is, when receiving the email all URL's is referencing 'localhost' instead of my domain causing the template to fall apart.
{{ URL::asset('assets/global/css/bootstrap.min.css') }}
becomes
http://localhost/assets/global/css/bootstrap.min.css
instead of
http://domain.com/assets/global/css/bootstrap.min.css
The asset() works great on all other views shown in a browser, even the email template. And the email I receive when sending from my local repo is working.
I have check that the .env value for APP_URL is correct, and I have tried to hard code the domain in config/app.php. I am using Forge and Envoyer.
This thread is the same problem as I have, just with Mail and not CLI: http://stackoverflow.com/questions/18947228/urlasset-with-php-artisan-command-gives-me-localhost-links
Does anyone know why this happens?