Send SMS ✉️from PHP
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitignore
.scrutinizer.yml
.travis.yml
LICENSE.md
README.md
composer.json
phpcs.xml.dist
phpstan.neon.dist
phpunit.xml

README.md

PHP Client for SmsManager.cz

Build Status Quality Score Downloads Code Coverage GitHub Issues

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().