[8.x] Expect custom markdown mailable themes to be in mail subdirectory #36673
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
config/mail.php
'stheme
asdefault
default.blade.php
. (IMO a perfectly reasonable name for a view to have in an application)The
default.css
won't be used because it'll try to usedefault.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
tofoo
, instead of just looking for a view namedfoo
it'll look formail.foo
.If you set
theme
tomail.foo
(like Mark would have done), it'll still just look formail.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.