Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Notifier] Add Free Mobile notifier #35690

Open
wants to merge 1 commit into
base: master
from

Conversation

@noniagriconomie
Copy link
Contributor

noniagriconomie commented Feb 12, 2020

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

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 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

1

2


Usage:

// .env file
FREEMOBILE_DSN=freemobile://LOGIN:PASSWORD@default

where LOGIN is your Free Mobile login and PASSWORD is the token displayed in the config panel

// config/packages/notifiers.yaml file
framework:
    notifier:
        texter_transports:
            freemobile: '%env(FREEMOBILE_DSN)%'

You can then use it like documented here https://symfony.com/doc/current/notifier/texters.html
Excepts that the phone number provided will not be used


Voil脿!

@noniagriconomie noniagriconomie force-pushed the noniagriconomie:feature-notifier-free-mobile branch from c9c1472 to 82e539a Feb 12, 2020
@noniagriconomie noniagriconomie force-pushed the noniagriconomie:feature-notifier-free-mobile branch from 82e539a to 0a37acb Feb 12, 2020
@nicolas-grekas nicolas-grekas added this to the next milestone Feb 12, 2020

public function supports(MessageInterface $message): bool
{
return $message instanceof SmsMessage;

This comment has been minimized.

Copy link
@Guikingone

Guikingone Feb 13, 2020

Contributor

What about checking an additional information about the $message as the payload is not exactly the same as others?

This comment has been minimized.

Copy link
@noniagriconomie

noniagriconomie Feb 13, 2020

Author Contributor

@Guikingone what do you mean?

like checking the sms phone is empty as it will be not used?

This comment has been minimized.

Copy link
@Guikingone

Guikingone Feb 13, 2020

Contributor

By example but I'm more worried about the fact that the TwilioTransport use the same approach to detect if it can support SmsMessage: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Notifier/Bridge/Twilio/TwilioTransport.php

I don't know if it's possible but it could be a good idea to differentiate both transport when it comes to detect if it can support the message ? 馃

This comment has been minimized.

Copy link
@noniagriconomie

noniagriconomie Feb 16, 2020

Author Contributor

It is the same implementation for Nexmo as well, so maybe there is another thing that differentiate the notifier event if it is 芦聽supported聽禄
I did not look at the internal component code yet tbh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can鈥檛 perform that action at this time.