Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/symfony/smsbox-notifier
Symfony Smsbox Notifier Bridge
https://github.com/symfony/smsbox-notifier
component notifier php sms smsbox symfony symfony-component
Last synced: about 1 month ago
JSON representation
Symfony Smsbox Notifier Bridge
- Host: GitHub
- URL: https://github.com/symfony/smsbox-notifier
- Owner: symfony
- License: mit
- Created: 2023-12-24T10:09:22.000Z (11 months ago)
- Default Branch: 7.1
- Last Pushed: 2024-09-27T08:38:58.000Z (about 2 months ago)
- Last Synced: 2024-09-30T16:03:26.884Z (about 2 months ago)
- Topics: component, notifier, php, sms, smsbox, symfony, symfony-component
- Language: PHP
- Homepage: https://symfony.com/notifier
- Size: 48.8 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
SMSBOX Notifier
---------------Provides [SMSBOX](https://www.smsbox.net/en/) integration for Symfony Notifier.
DSN example
-----------```
SMSBOX_DSN=smsbox://APIKEY@default?mode=MODE&strategy=STRATEGY&sender=SENDER
```where:
- `APIKEY` is your SMSBOX api key
- `MODE` is the sending mode
- `STRATEGY` is the type of your message
- `SENDER` is the sender name## You can add numerous options to a message
With a SMSBOX Message, you can use the SmsboxOptions class and use the setters to add [message options](https://www.smsbox.net/en/tools-development#developer-space)
```php
use Symfony\Component\Notifier\Bridge\Smsbox\Enum\Charset;
use Symfony\Component\Notifier\Bridge\Smsbox\Enum\Day;
use Symfony\Component\Notifier\Bridge\Smsbox\Enum\Encoding;
use Symfony\Component\Notifier\Bridge\Smsbox\Enum\Mode;
use Symfony\Component\Notifier\Bridge\Smsbox\Enum\Strategy;
use Symfony\Component\Notifier\Bridge\Smsbox\Enum\Udh;
use Symfony\Component\Notifier\Bridge\Smsbox\SmsboxOptions;
use Symfony\Component\Notifier\Message\SmsMessage;$sms = new SmsMessage('+33123456789', 'Your %1% message %2%');
$options = (new SmsboxOptions())
->mode(Mode::Expert)
->strategy(Strategy::NotMarketingGroup)
->sender('Your sender')
->date('DD/MM/YYYY')
->hour('HH:MM')
->coding(Encoding::Unicode)
->charset(Charset::Iso1)
->udh(Udh::DisabledConcat)
->callback(true)
->allowVocal(true)
->maxParts(2)
->validity(100)
->daysMinMax(min: Day::Tuesday, max: Day::Friday)
->hoursMinMax(min: 8, max: 10)
->variable(['variable1', 'variable2'])
->dateTime(new \DateTime())
->destIso('FR');$sms->options($options);
$texter->send($sms);
```