diff --git a/src/Illuminate/Notifications/Messages/MailMessage.php b/src/Illuminate/Notifications/Messages/MailMessage.php index d847072c8f59..280f2e1f2e2e 100644 --- a/src/Illuminate/Notifications/Messages/MailMessage.php +++ b/src/Illuminate/Notifications/Messages/MailMessage.php @@ -129,6 +129,21 @@ public function view($view, array $data = []) return $this; } + /** + * Set the plain text view for the mail message. + * + * @param string $textView + * @param array $data + * @return $this + */ + public function text($textView, array $data = []) + { + return $this->view([ + 'html' => is_array($this->view) ? ($this->view['html'] ?? null) : $this->view, + 'text' => $textView, + ], $data); + } + /** * Set the Markdown template for the notification. *