[5.6] Allow to set plain HTML in mails#22809
Merged
taylorotwell merged 4 commits intolaravel:5.6from Jan 18, 2018
abellion:5.6-html-mail
Merged
[5.6] Allow to set plain HTML in mails#22809taylorotwell merged 4 commits intolaravel:5.6from abellion:5.6-html-mail
taylorotwell merged 4 commits intolaravel:5.6from
abellion:5.6-html-mail
Conversation
Member
|
Can you explain more what you mean by "plain" HTML? Doesn't the mailer already allow you to send views? Or you mean there is no view at all? |
Contributor
Author
|
Yeah there is no view at all. |
Member
|
I'm wondering if it makes sense to do this. AFAIK it's good practice to always include a text part: if (isset($this->html)) {
return array_filter([
'html' => new HtmlString($this->html),
'text' => isset($this->textView) ? $this->textView : null,
]);
} |
Contributor
Author
|
Yes you're right, I've updated the Should I also update the one from the public function html($html, $callback, $plain = null);What do you think ? The |
Member
|
I don't think it's necessary on Mailer since I could always just call Mail::send(['html' => foo, 'text' => bar]) already. So it's already possible there. |
Contributor
Author
|
Makes sense. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We use MJML as a template engine for our mails. It returns us plain HTML, so having this PR merged would make easier setting plain HTML to mails (we use a blade "wrapper" today as a workaround).