https://github.com/net-tools/sms
https://github.com/net-tools/sms
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/net-tools/sms
- Owner: net-tools
- License: mit
- Created: 2021-03-04T16:25:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-20T11:40:23.000Z (over 2 years ago)
- Last Synced: 2025-06-08T11:08:20.972Z (about 1 year ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# net-tools/sms
## Root composer library to send SMS through an host such as AWS SNS or OVH
## Setup instructions
To install net-tools/sms package, just require it through composer : `require net-tools/sms:^1.0.0`.
Don't forget to append the real implementation : `require net-tools/sms-aws:^1.0.0` or `require net-tools/sms-ovh:^1.0.0`
## How to use ?
This project makes it possible to send SMS through AWS SNS or OVH provider
```php
// create the $snsclient ; please refer to AWS API reference to see how to create the client
// creating config ; actual parameters vary along providers
$config = new \Nettools\Core\Misc\ObjectConfig((object)['sanitizeSenderId' => true]);
// create the api gateway
$gw = new Aws\ApiGateway($snsclient, $config);
// send a sms to several recipients, and this is a transactionnal message (last parameter set to True)
$gw->send('Appointment confirmed !', 'CLINIC', ['+XXYYYYYYYYY', '+XXZZZZZZZZZZ'], true);
// if there are many recipients, call bulkSend insted, with same parameters, as it's more optimized
```
The APIs supported are : AWS and OVH.
## PHPUnit
To test with PHPUnit, point the -c configuration option to the /phpunit.xml configuration file.