PHP code example of sensetivity / sms-fly

1. Go to this page and download the library: Download sensetivity/sms-fly 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/ */

    

sensetivity / sms-fly example snippets


// your config/bootstrap.php file

Plugin::load('SMSFly', ['bootstrap' => false, 'routes' => false]);


// your controller

$this->loadComponent('SMSFly.SMSFly', [
    'username' => 'YOUR_USERNAME',
    'password' => 'YOUR_PASSWORD',
]);

// your controller


// Send for one:
$this->SMSFly->sendSMS(380930001100, 'Some SMS-body message');

// Send SMS to many:
$this->SMSFly->sendSMSToMany([
        380930001100,
        380970001100
   ], 'Тестовий текст для багатьох номерів'); // Cyrillic also working.

// Send SMS for one user.
$this->SMSFly->sendSMS(380930001100, 'Some SMS-body message');

// Send SMS with same text for many users.
$this->SMSFly->sendSMSToMany([
        380930001100,
        380970001100
   ], 'Тестовий текст для багатьох номерів'); // Cyrillic also working.

// Check balance on your account.
$this->SMSFly->getBalance();

// Check the SMS count that left on your account.
$this->SMSFly->getSMSCount();