Skip to content

[9.x] Fix directory for nested markdown files for mailables - #41366

Merged
taylorotwell merged 1 commit into
laravel:9.xfrom
ahinkle:patch-1
Mar 7, 2022
Merged

[9.x] Fix directory for nested markdown files for mailables#41366
taylorotwell merged 1 commit into
laravel:9.xfrom
ahinkle:patch-1

Conversation

@ahinkle

@ahinkle ahinkle commented Mar 6, 2022

Copy link
Copy Markdown
Contributor

This PR allows for the correct location on nested markdown mailables. Useful for applications with many mailables.

Currently, if you create a mailable with a nested location, it will generate a mailable class in the nested directory. However, the markdown will be in the mail directory and not within the nested directory.

php artisan make:mail Registration/WelcomeEmail -m

// generates:
app\Mail\Registration\WelcomeEmail.php
resources\views\mail\welcome-email.blade.php

This PR will place the blade in the proper nested directory.

Proposed:

php artisan make:mail Registration/WelcomeEmail -m

// generates:
app\Mail\Registration\WelcomeEmail.php
resources\views\mail\registration\welcome-email.blade.php

of course, you can manually override the location with --markdown=(location) but this fixes the directory when an empty markdown location is provided.

I didn't see any tests for this but I tested this thoroughly locally. Thanks!

@GrahamCampbell GrahamCampbell changed the title Fix directory for nested markdown files for mailables [9.x] Fix directory for nested markdown files for mailables Mar 6, 2022
@taylorotwell
taylorotwell merged commit b7625b3 into laravel:9.x Mar 7, 2022
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.

3 participants