How to override notification templates and css in Laravel 5.5?
Hello,
I'm trying to create a custom view for all my notifications. I have pushed the views from vendor with php artisan vendor:publish --tag=laravel-notifications which created the needed files in the mail/html and mail/markdown folders in my resources folder.
But when I, let's say, change the buttons file my changes are not reflected. Laravel is still using the view that's stored in the vendor dir. So I ran php artisan vendor:publish --tag=laravel-mail and this got me the notifications/email.blade.php file in my recources folder.
When I change the path to the buttons component in this file my changes are visible in my email. Change: @component('mail::button to: @component('vendor.mail.html.button.
Even though this works for the HTML I seriously doubt this is the right approach. Shouldn't it be sufficient to leave the email.blade.php. Is there somewhere else I need to set some config so it takes the right template (from my resources folder, not from the vendor)?
Because even though this seems weird to me, when trying to change the styling I do have a problem. When sending a notification it's still using default.css from the vendor folder. When I dig into the code I find at vendor/laravel/framework/src/Illuminate/Mail/Markdown.php:63:
return new HtmlString(($inliner ?: new CssToInlineStyles)->convert(
$contents, $this->view->make('mail::themes.'.$this->theme)->render()
));
A pretty hard-coded "mail::themes" reference. So do I make Laravel understand that whatever mail:: is pointing towards should be looking in my resource-folder first, and then in the vendor. (This is what the docs says is how it should work, but isn't).
What am I doing wrong? Not sure what extra information I need to provide so if you need anything specific let me know and I will post
Please or to participate in this conversation.