Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Expect custom markdown mailable themes to be in mail subdirectory #36673

Merged
merged 1 commit into from
Mar 21, 2021
Merged

[8.x] Expect custom markdown mailable themes to be in mail subdirectory #36673

merged 1 commit into from
Mar 21, 2021

Conversation

jasonvarga
Copy link
Contributor

Issue:

If you have a view named the same as your markdown theme, it will use that as the CSS file and cause an unstyled mailable.

This was introduced in 5f78c90 in order to implement #34391

Related: statamic/cms#2747

Steps To Reproduce:

  • Keep your config/mail.php's theme as default
  • Create a view named default.blade.php. (IMO a perfectly reasonable name for a view to have in an application)
  • Send a mailable.
  • See the mailable is unstyled.

The default.css won't be used because it'll try to use default.blade.php.

PR Proposal:

This PR attempts to solve both the original request in #34391 and this issue by expecting any custom themes to be located in a mail subdirectory.

Mark's request there looked to be like he basically wanted to be able to define mail themes without needing a vendor directory.

If you set theme to foo, instead of just looking for a view named foo it'll look for mail.foo.

If you set theme to mail.foo (like Mark would have done), it'll still just look for mail.foo and will be a non-breaking change.

This change is only considered breaking if you had a custom css file in the root or a subdirectory that wasn't named mail. That feels unlikely. Also, this feature was never documented.

@taylorotwell taylorotwell merged commit 0ee9a4b into laravel:8.x Mar 21, 2021
@taylorotwell
Copy link
Member

IMO the original PR should probably be reverted but we will roll with this for now and see how it goes.

@jasonvarga jasonvarga deleted the fix/markdown-mailable branch March 22, 2021 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants