Skip to content

Commit 081abd6

Browse files
committed
[Notifier] Create DesktopChannel and JoliNotif bridge
1 parent a8a9652 commit 081abd6

File tree

1 file changed

+72
-4
lines changed

1 file changed

+72
-4
lines changed

notifier.rst

+72-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Get the Notifier installed using:
1616
1717
.. _channels-chatters-texters-email-and-browser:
1818

19-
Channels: Chatters, Texters, Email, Browser and Push
20-
----------------------------------------------------
19+
Channels: Chatters, Texters, Email, Browser, Push and Desktop
20+
-------------------------------------------------------------
2121

2222
The notifier component can send notifications to different channels. Each
2323
channel can integrate with different providers (e.g. Slack or Twilio SMS)
@@ -32,6 +32,7 @@ The notifier component supports the following channels:
3232
* :ref:`Email channel <notifier-email-channel>` integrates the :doc:`Symfony Mailer </mailer>`;
3333
* Browser channel uses :ref:`flash messages <flash-messages>`.
3434
* :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.
3536

3637
.. tip::
3738

@@ -623,6 +624,71 @@ configure the ``texter_transports``:
623624
;
624625
};
625626
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+
626692
Configure to use Failover or Round-Robin Transports
627693
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
628694

@@ -926,9 +992,10 @@ and its ``asChatMessage()`` method::
926992

927993
The
928994
:class:`Symfony\\Component\\Notifier\\Notification\\SmsNotificationInterface`,
929-
:class:`Symfony\\Component\\Notifier\\Notification\\EmailNotificationInterface`
930-
and
995+
:class:`Symfony\\Component\\Notifier\\Notification\\EmailNotificationInterface`,
931996
:class:`Symfony\\Component\\Notifier\\Notification\\PushNotificationInterface`
997+
and
998+
:class:`Symfony\\Component\\Notifier\\Notification\\DesktopNotificationInterface`
932999
also exists to modify messages sent to those channels.
9331000

9341001
Customize Browser Notifications (Flash Messages)
@@ -1114,6 +1181,7 @@ is dispatched. Listeners receive a
11141181
.. _`Infobip`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Infobip/README.md
11151182
.. _`Iqsms`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/Iqsms/README.md
11161183
.. _`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
11171185
.. _`KazInfoTeh`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/KazInfoTeh/README.md
11181186
.. _`LINE Notify`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/LineNotify/README.md
11191187
.. _`LightSms`: https://github.com/symfony/symfony/blob/{version}/src/Symfony/Component/Notifier/Bridge/LightSms/README.md

0 commit comments

Comments
 (0)