Robbus's avatar

Notifications vs Flash messages

Hi Guys,

Quick question: I can't seem to wrap my mind around the difference between flash messages and notifications. From what I understand is that notifications are used to for example send an email to the user upon completing a task. Notification uses different drivers, such as SMS and email.

Flash messages on the otherhand are messages that use sessions. So if i want to display a little "notification" in the bottom of the users screen "Task complete". Are those two entirely different things, or can I use Notifications for the flash message aswell?

Would you be able to use them together? IE: Display a flash message and send an email?

Thanks in advance for clearing this up.

0 likes
2 replies
afrayedknot's avatar
Level 14

You kind of answered your own question. A "flash" message means it is available for the next request only. It is only used to display a message on the screen to a user. It cannot be used to send SMS etc.

So flash messages are used for things like validation errors, or messages such as "your document has been saved" etc. They are forgotten and not saved.

You would not generally use notifications for these types of messages. Notifications are best for alerting "outside" your application - i.e. to email, SMS etc. Notifications are also stored, so you could display a history in your application etc.

There is nothing wrong with an event causes a flash message (to display the task complete) and also sending a notification to email, SMS etc.

Please or to participate in this conversation.