simpod / sms-manager
PHP library for sending SMS via SmsManager.cz
Installs: 30 036
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 2
Requires
- php: ^7.2
- ext-dom: *
- ext-simplexml: *
- beberlei/assert: ^3.1
- consistence/consistence: ^1.0 | ^2.0
- guzzlehttp/guzzle: ^6.0
Requires (Dev)
- doctrine/coding-standard: ^7.0
- phpstan/phpstan: ^0.11.5
- phpstan/phpstan-beberlei-assert: ^0.11.0
- phpstan/phpstan-phpunit: ^0.11.0
- phpstan/phpstan-strict-rules: ^0.11.0
- phpunit/phpunit: ^8
This package is auto-updated.
Last update: 2020-03-29 13:21:20 UTC
README
Library for PHP that can send SMS messages via SmsManager.cz gateway. (not all API methods are implemented for now)
Installation
composer require simpod/sms-manager
Usage
Use SmsManager
interface in your code, eg.:
public function __construct(SmsManager $smsManager) { ... }
and alias SMSManager to ApiSmsManager
for your production usage.
Example with Symfony:
services: SimPod\SmsManager\SmsManager: alias: SimPod\SmsManager\ApiSmsManager
To send message, create new SmsMessage
:
$smsMessage = new SmsMessage( 'message text', [ '+420777888999' ], RequestType::getRequestTypeLow() // optional, defaults to High 'sender' // optional 1 // optional, CustomID ); $smsManager->send($smsMessage);
Third parameter of SmsMessage
is RequestType that is represented by RequestType
class. Eg. low request type is instantiated with RequestType::getRequestTypeLow()
.