danaketh / sms-manager
PHP library for sending SMS via SmsManager.cz
Installs: 1 418
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
Open Issues: 1
Requires
- php: ^7.4 | ^8
- ext-dom: *
- ext-libxml: *
- ext-simplexml: *
- beberlei/assert: ^3.1
- guzzlehttp/guzzle: ^7.5
Requires (Dev)
- doctrine/coding-standard: ^10.0
- phpstan/phpstan: ^1.9
- phpstan/phpstan-beberlei-assert: ^1.0
- phpstan/phpstan-phpunit: ^1.3
- phpstan/phpstan-strict-rules: ^1.4
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-03-13 19:03:36 UTC
README
Library for PHP that can send SMS messages via SmsManager.cz gateway. PHP8 fork of SMSManager. (not all API methods are implemented for now)
Installation
composer require danaketh/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()
.