PHP code example of maksimusyan / sms-sender

1. Go to this page and download the library: Download maksimusyan/sms-sender library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

maksimusyan / sms-sender example snippets


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

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

$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);

$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);

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

$countries = $sms->getCountryCodes();