Laravel 5.3 Notification Vs Mailable

陌路散爱 提交于 2019-12-03 04:29:04

Yes, definitively, if each email layout is different, you should use Mailable

Mailable is the new way to send emails, easier than before. More customizable than Notifications.

Notification is very nice if you want to send a predefined layout in differents channel ( Mail, SMS, Slack, etc )

You can customize notifications layout, but having 1 layout by notification is going to get more difficult... it is just not the use case for notifications

Although it is not in the documentation, as of Laravel 5.3.7, the Notifications mail channel can work with Mailable objects in addition to the notification MailMessage objects.

Therefore, you can create all your emails as Mailable objects, and if you decide to send them via Notifications, you would just have your toMail() method return the Mailable objects you've already made.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!