-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Description
- Laravel Version: v7.22.4
- PHP Version: v7.4.3
- Database Driver & Version: MySQL v5.7.24
Description:
It is possible to send a html and plain email with a Mail which extends Mailable. If you want to send a Notification and want to send a html and plain email then you get an error because it is not possible to attach a plain view.
Steps To Reproduce:
Not working example with notifications:
- Create a new notification with
php artisan make:notification TestNotification
- Add the following Code to the notification:
public function toMail($notifiable)
{
return (new MailMessage)
->view('mail.test.html')
->text('mail.test.plain'); // Not existing
}
- Execute the toMail-Method
Working Example with Mails:
- Create a new notification with
php artisan make:notification TestNotification
- Add the following aode to the notification:
public function build()
{
return $this->view('mail.test.html')
->text('mail.test.plain');
}
- Try to send Mail
Metadata
Metadata
Assignees
Labels
No labels