Laravel 5.7 upgrades break published email styles

I’ve been updating some old Laravel apps and I just came across this issue with updating from 5.6 to 5.7. It’s noted in the upgrade docs (see “Template Theme”) but easy to miss. I know I’ll come across this again, so it’s worth noting here for the future.

If you have published your mail templates to customise them, when you upgrade to Laravel 5.7 the button classes change from button-blue, button-green and button-red to button-primary, button-success, and button-error.

This results in the action button in the password reset email being white or unreadable because it has no background style.

The fix for this is to edit resources/views/vendor/mail/html/themes/default.css and change:

.button-blue {
   ...
}

.button-green {
   ...
}

.button-red {
   ...
}

to

.button-blue,
.button-primary {
   ...
}

.button-green,
.button-success {
   ...
}

.button-red,
.button-error {
   ...
}

You can see the equivalent Laravel 5.7 file in GitHub.

Leave a Reply

Your email address will not be published. Required fields are marked *