PHP code example of ifeech / smsaero-v2

1. Go to this page and download the library: Download ifeech/smsaero-v2 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/ */

    

ifeech / smsaero-v2 example snippets




use Feech\SmsAero\Auth\Auth;
use Feech\SmsAero\Client\ClientGuzzle;
use Feech\SmsAero\SmsAero;
use Feech\SmsAero\Sms\Sms;

$auth = new Auth('email', 'pass');
$client = new ClientGuzzle($auth);

$smsAero = new SmsAero($client);
$sms1 = new Sms('79591234567', 'Тестовое сообщение', SMS::CHANNEL_TYPE_INTERNATIONAL);
$sms2 = new Sms(['79591234567', '79599876543'], 'Тестовое сообщение', SMS::CHANNEL_TYPE_DIGITAL);

try {
    $smsAero->testSend($sms1); // тестовое сообщение
    $smsAero->send($sms1); // отправка сообщения
    $response = $smsAero->bulkSend($sms1); // массовая отправка сообщений

    $responseArray = json_decode($response, true); // ответ в виде ассоциативного массива
} catch (Exception $e) {
    $e->getMessage();
}

bash
$ php composer.phar install ifeech/smsaero-v2