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

[5.6] Render the right view when using Mailables for sending mails just in plain text format #23981

Merged
merged 3 commits into from
Apr 25, 2018

Conversation

czmole
Copy link
Contributor

@czmole czmole commented Apr 23, 2018

This is supposed to fix the case from ticket #23822 and probably #1058

When using Mailables to send e-mails just in plain text format, it was being sent to render only the HTML view. With this change, it will check first if the HTML is present, if not it will send to render the plain text view.

Apologies if this is very straight forward, this is my first PR to Laravel, even if I am using it for about 4 years.

@czmole czmole changed the title Render the right view when sending mails just in plain text format Render the right view when using Mailables for sending mails just in plain text format Apr 23, 2018
@tillkruss tillkruss changed the title Render the right view when using Mailables for sending mails just in plain text format [5.6] Render the right view when using Mailables for sending mails just in plain text format Apr 23, 2018
@sisve
Copy link
Contributor

sisve commented Apr 24, 2018

This looks like something that could use some tests.

@czmole
Copy link
Contributor Author

czmole commented Apr 24, 2018

I am very new to this, will try to find a way to cover that.
Thank you.

@GrahamCampbell
Copy link
Member

I've fixed your code duplication for you.

@sisve
Copy link
Contributor

sisve commented Apr 25, 2018

You can find the existing tests for the Mailer class in https://github.com/laravel/framework/blob/5.6/tests/Mail/MailMailerTest.php. Copy the one that is closest match to your scenario, and modify it to test your new functionality.

@taylorotwell taylorotwell merged commit f6a3f4f into laravel:5.6 Apr 25, 2018
@taylorotwell
Copy link
Member

Looks pretty straight forward.

@czmole
Copy link
Contributor Author

czmole commented Apr 25, 2018

Thank you. Will still look into putting a test for this, continuous learning :)

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.

None yet

5 participants