Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexeevdv/php-sms-smsru
PHP package for sending SMS messages via sms.ru provider
https://github.com/alexeevdv/php-sms-smsru
Last synced: about 1 month ago
JSON representation
PHP package for sending SMS messages via sms.ru provider
- Host: GitHub
- URL: https://github.com/alexeevdv/php-sms-smsru
- Owner: alexeevdv
- License: mit
- Created: 2020-06-01T08:21:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T12:16:30.000Z (over 4 years ago)
- Last Synced: 2024-10-23T12:24:18.413Z (3 months ago)
- Language: PHP
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# php-sms-smsru
[![Build Status](https://travis-ci.org/alexeevdv/php-sms-smsru.svg?branch=master)](https://travis-ci.org/alexeevdv/php-sms-smsru)
[![codecov](https://codecov.io/gh/alexeevdv/php-sms-smsru/branch/master/graph/badge.svg)](https://codecov.io/gh/alexeevdv/php-sms-smsru)
![PHP 7.1](https://img.shields.io/badge/PHP-7.1-green.svg)
![PHP 7.2](https://img.shields.io/badge/PHP-7.2-green.svg)
![PHP 7.3](https://img.shields.io/badge/PHP-7.3-green.svg)
![PHP 7.4](https://img.shields.io/badge/PHP-7.4-green.svg)PHP package for sending SMS messages via sms.ru provider
## Usage
```php
use alexeevdv\Sms\SmsRu\Exception\Exception as SmsRuException;
use alexeevdv\Sms\SmsRu\PhoneNumber;
use alexeevdv\Sms\SmsRu\Provider;$httpClient = new Psr18CompatibleHttpClient();
$requestFactory = new Psr17CompatibleRequestFactory();$provider = new Provider('Your API key', $httpClient, $requestFactory);
try {
$messageId = $provider->sendMessage(new PhoneNumber('+1-234-567-89-10'), 'Hello!');
} catch (SmsRuException $e) {
// Message is not sent
}
```