maksimusyan/sms-sender

Sending sms via api Epochta.

1.2.1 2018-05-08 13:23 UTC

This package is not auto-updated.

Last update: 2024-11-19 04:28:55 UTC


README

Sending sms via api Epochta

Library is published on the Composer: https://packagist.org/packages/maksimusyan/sms-sender

Connect a stable version through the Composer:

composer require maksimusyan/sms-sender

{
    "require": {
        "maksimusyan/sms-sender": "^1.2"
    }
}

or the developer version directly from github:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "git://github.com/maksimusyan/sms-sender.git"
    }
  ],
    "require": {
        "maksimusyan/sms-sender": "dev-master"
    }
}

Basic Usage:

$provider = 'Epochta';
$config = array(
    'key_private' => 'YOUR_API_PRIVATE_KEY'
    ,'key_public' => 'YOUR_API_PUBLIC_KEY'
    //,'url_gateway' => 'http://api.atompark.com/sms/3.0/'
    //,'testmode' => false
);

$sms = new \Maksimusyan\SmsSender\Sender($provider,$config);

API methods

Send SMS:

$data = array(
    'sender' => 'MYCOMPANY', // Sender ID. Maximum 11 characters
    'text' => 'You have successfully made a purchase', // Message text 
    'phone' => '79008881155', // Number of recipient
    'datetime' => '2018-05-01 00:20:00', // Sending at the set time
    'sms_lifetime' => '0' //SMS life time (0 = maximum, 1, 6, 12, 24 hour)
);
$sms->sendSMS($data);

Get balance:

$currency = 'RUB'; // Available currencies: 'USD','GBP','UAH','RUB','EUR'
$balance = $sms->getBalance($currency);

Get country codes:

$countries = $sms->getCountryCodes();