Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/symfony/sweego-notifier
Symfony Sweego Notifier Bridge
https://github.com/symfony/sweego-notifier
component notifier php sms sweego symfony symfony-component
Last synced: 19 days ago
JSON representation
Symfony Sweego Notifier Bridge
- Host: GitHub
- URL: https://github.com/symfony/sweego-notifier
- Owner: symfony
- License: mit
- Created: 2024-10-18T06:59:23.000Z (30 days ago)
- Default Branch: 7.2
- Last Pushed: 2024-10-27T15:25:24.000Z (20 days ago)
- Last Synced: 2024-10-27T19:13:08.846Z (20 days ago)
- Topics: component, notifier, php, sms, sweego, symfony, symfony-component
- Language: PHP
- Homepage: https://symfony.com/notifier
- Size: 8.79 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Sweego Notifier
===============Provides [Sweego](https://www.sweego.io/) integration for Symfony Notifier.
DSN example
-----------```
SWEEGO_DSN=sweego://API_KEY@default?region=REGION&campaign_type=CAMPAIGN_TYPE&bat=BAT&campaign_id=CAMPAIGN_ID&shorten_urls=SHORTEN_URLS&shorten_with_protocol=SHORTEN_WITH_PROTOCOL
```where:
- `API_KEY` (required) is your Sweego API key
- `REGION` (required) is the region of the phone number (e.g. `FR`, ISO 3166-1 alpha-2 country code)
- `CAMPAIGN_TYPE` (required) is the type of the campaign (e.g. `transac`)
- `BAT` (optional) is the test mode (e.g. `true`)
- `CAMPAIGN_ID` (optional) is the campaign id (e.g. `string`)
- `SHORTEN_URLS` (optional) is the shorten urls option (e.g. `true`)
- `SHORTEN_WITH_PROTOCOL` (optional) is the shorten with protocol option (e.g. `true`)Advanced Message options
------------------------```php
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Bridge\Sweego\SweegoOptions;$sms = new SmsMessage('+1411111111', 'My message');
$options = (new SweegoOptions())
// False by default, set 'bat' to true enable test mode (no sms sent, only for testing purpose)
->bat(true)
// Optional, used for tracking / filtering purpose on our platform; identity an SMS campaign and allow to see logs / stats only for this campaign
->campaignId('string')
// True by default, we replace all url in the SMS content by a shortened url version (reduce the characters of the sms)
->shortenUrls(true)
// True by default, add scheme to shortened url version
->shortenWithProtocol(true);// Add the custom options to the sms message and send the message
$sms->options($options);$texter->send($sms);
```Resources
---------* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)