Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/socialconnect/sms
Send SMS by external services
https://github.com/socialconnect/sms
php-sms
Last synced: about 1 month ago
JSON representation
Send SMS by external services
- Host: GitHub
- URL: https://github.com/socialconnect/sms
- Owner: SocialConnect
- Created: 2015-10-30T21:15:59.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-14T12:58:20.000Z (over 8 years ago)
- Last Synced: 2024-10-29T21:06:00.941Z (about 2 months ago)
- Topics: php-sms
- Language: PHP
- Homepage:
- Size: 39.1 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
SocialConnect SMS
=================## Supported providers
- [x] Nexmo
- [x] MessageBird
- [x] SMS.RU## Installation
Add a requirement to your `composer.json`:
```json
{
"require": {
"socialconnect/sms": "*"
}
}
```Run the composer installer:
```bash
php composer.phar install
```## How to work
First, you need to setup `ProviderFactory`:
```php
use SocialConnect\Common\Http\Client\Curl;
use SocialConnect\SMS\ProviderFactory;include_once __DIR__ . '/vendor/autoload.php';
$service = new ProviderFactory(
array(
'provider' => array(
'smsru' => array(
'appId' => 12345
)
)
),
new Curl()
);
```Next, you need to get provider:
```php
/** @var \SocialConnect\SMS\Provider\SMSRU $provider */
$provider = $service->factory('smsru');
```You can send `sms`:
```php
$provider->send('+79999999', 'Hello, World!');
```Or get `balance`:
```php
var_dump($provider->getBalance());
```# License
This project is open-sourced software licensed under the MIT License.
See the LICENSE file for more information.