PHP code example of sajjad-rakhshani / ir-sms-gates

1. Go to this page and download the library: Download sajjad-rakhshani/ir-sms-gates 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/ */

    

sajjad-rakhshani / ir-sms-gates example snippets


//log to IrSms.log in your document root
$log = new IrSmsGates\GateWays\Log();
$log->send(); //bool

//log to your specific log file
$log = new IrSmsGates\Gateways\Log('your_file');
$log->send(); //bool

$melipayamak = new IrSmsGates\Gateways\MeliPayamak($username, $passowrd);

//simple send
$melipayamak
    ->from($from) // send from
    ->to($to) // a number or array of numbers
    ->text($text)
    ->send(); //bool

//send with pattern
$melipayamak
    ->to($to) // only one number
    ->text($pattern_vars) // an array of your pattern variables (only values). ['var1', 'var2', ...]
    ->pattern($pattern) //your pattern code in melipayamak
    ->send(); //bool

$ipPanel = new \IrSmsGates\Gateways\IpPanel($api_key);
//simple send
$ipPanel
    ->from($from) //send from
    ->to($to) // a number or array of numbers
    ->text($text)
    ->send(); //bool
//send with pattern
$ipPanel
    ->from($from) //send from
    ->to($to) //only on number
    ->pattern($pattern) //pattern code
    ->text($pattern_vars) //an array of your pattern variables. ['var1' => 'value1', 'var2' => 'value2', ...]