@@ -16,8 +16,8 @@ Get the Notifier installed using:
16
16
17
17
.. _channels-chatters-texters-email-and-browser :
18
18
19
- Channels: Chatters, Texters, Email, Browser and Push
20
- ----------------------------------------------------
19
+ Channels: Chatters, Texters, Email, Browser, Push and Desktop
20
+ -------------------------------------------------------------
21
21
22
22
The notifier component can send notifications to different channels. Each
23
23
channel can integrate with different providers (e.g. Slack or Twilio SMS)
@@ -32,6 +32,7 @@ The notifier component supports the following channels:
32
32
* :ref: `Email channel <notifier-email-channel >` integrates the :doc: `Symfony Mailer </mailer >`;
33
33
* Browser channel uses :ref: `flash messages <flash-messages >`.
34
34
* :ref: `Push channel <notifier-push-channel >` sends notifications to phones and browsers via push notifications.
35
+ * :ref: `Desktop channel <notifier-desktop-channel >` displays desktop notifications on the same host machine.
35
36
36
37
.. tip ::
37
38
@@ -623,6 +624,71 @@ configure the ``texter_transports``:
623
624
;
624
625
};
625
626
627
+ .. _notifier-desktop-channel :
628
+
629
+ Desktop Channel
630
+ ~~~~~~~~~~~~~~~
631
+
632
+ The desktop channel is used to display desktop notifications on the same host machine using
633
+ :class: `Symfony\\ Component\\ Notifier\\ Texter ` classes. Currently, Symfony
634
+ is integrated with the following providers:
635
+
636
+ =============== ==================================== ==============================================================================
637
+ Provider Package DSN
638
+ =============== ==================================== ==============================================================================
639
+ `JoliNotif `_ ``symfony/joli-notif-notifier `` ``jolinotif://default ``
640
+ =============== ==================================== ==============================================================================
641
+
642
+ To enable a texter, add the correct DSN in your ``.env `` file and
643
+ configure the ``texter_transports ``:
644
+
645
+ .. code-block :: bash
646
+
647
+ # .env
648
+ JOLINOTIF=jolinotif://default
649
+
650
+ .. configuration-block ::
651
+
652
+ .. code-block :: yaml
653
+
654
+ # config/packages/notifier.yaml
655
+ framework :
656
+ notifier :
657
+ texter_transports :
658
+ jolinotif : ' %env(JOLINOTIF)%'
659
+
660
+ .. code-block :: xml
661
+
662
+ <!-- config/packages/notifier.xml -->
663
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
664
+ <container xmlns =" http://symfony.com/schema/dic/services"
665
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
666
+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
667
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
668
+ https://symfony.com/schema/dic/services/services-1.0.xsd
669
+ http://symfony.com/schema/dic/symfony
670
+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
671
+
672
+ <framework : config >
673
+ <framework : notifier >
674
+ <framework : texter-transport name =" jolinotif" >
675
+ %env(JOLINOTIF)%
676
+ </framework : texter-transport >
677
+ </framework : notifier >
678
+ </framework : config >
679
+ </container >
680
+
681
+ .. code-block :: php
682
+
683
+ // config/packages/notifier.php
684
+ use Symfony\Config\FrameworkConfig;
685
+
686
+ return static function (FrameworkConfig $framework): void {
687
+ $framework->notifier()
688
+ ->texterTransport('jolinotif', env('JOLINOTIF'))
689
+ ;
690
+ };
691
+
626
692
Configure to use Failover or Round-Robin Transports
627
693
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
628
694
@@ -926,9 +992,10 @@ and its ``asChatMessage()`` method::
926
992
927
993
The
928
994
:class: `Symfony\\ Component\\ Notifier\\ Notification\\ SmsNotificationInterface `,
929
- :class: `Symfony\\ Component\\ Notifier\\ Notification\\ EmailNotificationInterface `
930
- and
995
+ :class: `Symfony\\ Component\\ Notifier\\ Notification\\ EmailNotificationInterface `,
931
996
:class: `Symfony\\ Component\\ Notifier\\ Notification\\ PushNotificationInterface `
997
+ and
998
+ :class: `Symfony\\ Component\\ Notifier\\ Notification\\ DesktopNotificationInterface `
932
999
also exists to modify messages sent to those channels.
933
1000
934
1001
Customize Browser Notifications (Flash Messages)
@@ -1114,6 +1181,7 @@ is dispatched. Listeners receive a
1114
1181
.. _`Infobip` : https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Infobip/README.md
1115
1182
.. _`Iqsms` : https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Iqsms/README.md
1116
1183
.. _`iSendPro` : https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Isendpro/README.md
1184
+ .. _`JoliNotif` : https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/JoliNotif/README.md
1117
1185
.. _`KazInfoTeh` : https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/KazInfoTeh/README.md
1118
1186
.. _`LINE Notify` : https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/LineNotify/README.md
1119
1187
.. _`LightSms` : https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/LightSms/README.md
0 commit comments