Skip to content
New issue

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

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

Already on GitHub? # to your account

[11.x] MailMakeCommand: Add new --view option #51411

Merged
merged 4 commits into from
May 20, 2024
Merged

[11.x] MailMakeCommand: Add new --view option #51411

merged 4 commits into from
May 20, 2024

Conversation

ryangjchandler
Copy link
Contributor

This pull request adds a new --view option to the make:mail command that will create a new empty Blade file and configure the Mailable to use it by default.

It behaves the same way as the existing --markdown option.

I imagine this would be a nice and small workflow optimisation for folks, including myself. I'm always creating new Blade views for regular HTML emails and manually updating the Mailable.

@ryangjchandler
Copy link
Contributor Author

Could a maintainer mark this as draft please so it doesn't show up on Taylor's feed? I still need to write tests :^)

@Jubeki
Copy link
Contributor

Jubeki commented May 14, 2024

@ryangjchandler you can do that on the right sidebar "Still in progress? Mark as draft"

@ryangjchandler ryangjchandler marked this pull request as draft May 14, 2024 17:46
@ryangjchandler
Copy link
Contributor Author

@ryangjchandler you can do that on the right sidebar "Still in progress? Mark as draft"

Has that button moved or something cause I could swear it used to show up on the bottom for me! Thanks :^)

@ryangjchandler ryangjchandler marked this pull request as ready for review May 14, 2024 17:52

$stub = str_replace(
'{{ quote }}',
Inspiring::quotes()->random(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can probably remove this since you're not actually using {{ quote }} anywhere in the stubs, not to mention an inspiring quote being injected into the mailable template makes no sense.

Copy link
Contributor

@ahinkle ahinkle May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahinkle ah nice I for some reason didn't realize it was the view stub being used, I thought it was one of the ones in the PR. Thanks!

$stub = str_replace(
'{{ quote }}',
Inspiring::quotes()->random(),
file_get_contents(__DIR__ . '/stubs/view.stub')
Copy link
Contributor

@ahinkle ahinkle May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated blade view stub here has a <div> in it. Wouldn't that be a little strange for emails? We might need a new mailable view stub.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought about adding a new stub for this but kept it simple for now and re-used the existing view.stub file. Will await feedback from others too :^)

taylorotwell and others added 2 commits May 20, 2024 09:38
Co-authored-by: Mior Muhammad Zaki <crynobone@gmail.com>
@taylorotwell taylorotwell merged commit 422d196 into laravel:11.x May 20, 2024
27 of 28 checks passed
@ryangjchandler ryangjchandler deleted the mail-view-option branch May 22, 2024 13:55
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants