File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 662
662
:class: `Symfony\\ Component\\ Notifier\\ Notification\\ EmailNotificationInterface `
663
663
also exists to modify messages sent to those channels.
664
664
665
+ Customize Browser Notifications (Flash Messages)
666
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
667
+
668
+ The default behaviour for Browser channel notifications is to add a flash
669
+ message with a key of "notification".
670
+
671
+ However, it may be desirable to map the importance level of the notification
672
+ to the type of flash message, so that you can style the different flash
673
+ messages according to their importance.
674
+
675
+ This can be done by overriding the default
676
+ 'notifier.flash_message_importance_mapper' service with your own implementation of
677
+ :class: `Symfony\\ Component\\ Notifier\\ FlashMessage\\ FlashMessageImportanceMapperInterface `
678
+ where you can provide your own "importance" to "alert level" mapping.
679
+
680
+ Symfony currently provides an implementation for the Bootstrap CSS framework's
681
+ typical alert levels, which you can implement immediately using:
682
+
683
+ .. code-block :: yaml
684
+
685
+ # config/services.yaml
686
+ services :
687
+ notifier.flash_message_importance_mapper : Symfony\Component\Notifier\FlashMessage\BootstrapFlashMessageImportanceMapper
688
+
665
689
Disabling Delivery
666
690
------------------
667
691
You can’t perform that action at this time.
0 commit comments