How to customize the email verification email from Laravel 5.7?

前端 未结 8 1556
感动是毒
感动是毒 2020-12-03 02:59

I just upgraded to Laravel 5.7 and now I am using the built in Email Verification. However there is 2 things I have not been able to figure out and the primary issue is how

8条回答
  •  孤城傲影
    2020-12-03 03:34

    Building slightly on the answer by Andrew Earls, you can also publish all the markdown mail components used by the application with this command:

    php artisan vendor:publish --tag=laravel-mail

    Once that's done you'll have a series of html and markdown files to modify in resources/views/vendor/mail. This will allow you to modify the overall email layout and also 'theme' the CSS. I'd highly recommend having a good read of the Mail docs - Customizing The Components.

    CSS theming

    As a general email theming quick-start (Laravel 5.7), you can:

    1. Publish the theme with php artisan vendor:publish --tag=laravel-mail .
    2. Copy resources/views/vendor/mail/html/themes/default.css to your own file. e.g resources/views/vendor/mail/html/themes/wayne.css
    3. Edit config/mail.php and where you see 'theme' => 'default' change it to 'theme' => 'wayne'
    4. Edit wayne.css to restyle your emails.

    Hope that helps someone.

提交回复
热议问题