Skip to content

Commit d02e28d

Browse files
committed
feature #35690 [Notifier] Add Free Mobile notifier (noniagriconomie)
This PR was merged into the 5.1-dev branch. Discussion ---------- [Notifier] Add Free Mobile notifier | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Implements symfony/symfony-docs#13025 (review) | License | MIT | Doc PR | Will document if accepted (see **Usage** below) ## Add a new notifier (SMS) with the French Free Mobile provider. It is a **special notifier** as it **only send the SMS to the self user**, but I think it can be **useful for notification alerting purposes** (the way I use it already, and plan to use it with the component) --- **Provider doc:** (🇫🇷 sorry) https://mobile.free.fr/moncompte/index.php?page=options <img width="716" alt="1" src="https://user-images.githubusercontent.com/13205768/74357784-b55c3500-4dc0-11ea-95ba-19ded062e800.png"> <img width="431" alt="2" src="https://user-images.githubusercontent.com/13205768/74357786-b7be8f00-4dc0-11ea-837e-b922c20e9a2e.png"> --- **Usage:** ``` // .env file FREEMOBILE_DSN=freemobile://LOGIN:PASSWORD@default?phone=PHONE ``` where: - `LOGIN` is your Free Mobile login - `PASSWORD` is the token displayed in the config panel - `PHONE` is your Free Mobile phone number ```yaml // config/packages/notifiers.yaml file framework: notifier: texter_transports: freemobile: '%env(FREEMOBILE_DSN)%' ``` Then you can then use it like documented here https://symfony.com/doc/current/notifier/texters.html ℹ️ As this is a special notifier, the `PHONE` provided inside the DSN mut be the same used [here](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Notifier/Message/SmsMessage.php#L31) for `$phone` value --- Voilà! Commits ------- 1b8709ee72 Add Free Mobile notifier
2 parents 5d0d3e2 + 65de824 commit d02e28d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Exception/UnsupportedSchemeException.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ class UnsupportedSchemeException extends LogicException
5050
'class' => Bridge\Firebase\FirebaseTransportFactory::class,
5151
'package' => 'symfony/firebase-notifier',
5252
],
53+
'freemobile' => [
54+
'class' => Bridge\FreeMobile\FreeMobileTransportFactory::class,
55+
'package' => 'symfony/freemobile-notifier',
56+
],
5357
'ovhcloud' => [
5458
'class' => Bridge\OvhCloud\OvhCloudTransportFactory::class,
5559
'package' => 'symfony/ovhcloud-notifier',

Transport.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Notifier;
1313

1414
use Symfony\Component\Notifier\Bridge\Firebase\FirebaseTransportFactory;
15+
use Symfony\Component\Notifier\Bridge\FreeMobile\FreeMobileTransportFactory;
1516
use Symfony\Component\Notifier\Bridge\Mattermost\MattermostTransportFactory;
1617
use Symfony\Component\Notifier\Bridge\Nexmo\NexmoTransportFactory;
1718
use Symfony\Component\Notifier\Bridge\OvhCloud\OvhCloudTransportFactory;
@@ -48,6 +49,7 @@ class Transport
4849
OvhCloudTransportFactory::class,
4950
FirebaseTransportFactory::class,
5051
SinchTransportFactory::class,
52+
FreeMobileTransportFactory::class,
5153
];
5254

5355
private $factories;

0 commit comments

Comments
 (0)