PHP code example of stanislav-web / phalcon-sms-factory

1. Go to this page and download the library: Download stanislav-web/phalcon-sms-factory 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/ */

    

stanislav-web / phalcon-sms-factory example snippets


"    "stanislav-web/phalcon-sms-factory": "1.2.*@stable",
}

    $di->set('SMS', function () use ($di) {

        return new SMSFactory\Sender($di);
    });


    // add to your app config and write down your settings .The key 'sms' is from'      => '',
                    'api_key'   => '',
                    'api_secret'=> '',
                    'type'      => '',
                    'request_method' => ''
                ],
                'BulkSMS'   =>  [
                    'username'  => '',
                    'password'  => '',
                ],
                'SmsAero' => [
                    'from'          => '',
                    'user'          => '',
                    'password'      => '',
                ],
                
                'SmsUkraine'       =>  [
                    'from'          => '',
                    'login'         => '',
                    'password'      => '',
                    'version'       => '',
                ],
                
                'SMSC'       =>  [
                    'login'     => '',
                    'psw'       => '',
                    'charset'   => '',
                    'sender'    => '',
                ],
        
                'SMSRu' => [
                    'api_id'    => ''
                ],
                
                'Clickatell'    => [
                    'api_id'    => '',
                    'user'      => '',
                    'password'  => '',
                    'from'      => '',
                    'request_method' => ''
                ],
                'MessageBird'   => [
                    'originator'   => '',
                    'access_key'   => '',
                    'request_method' => ''
                ]           
    ];



    // get sms service
    $sms = $this->di->get('SMS');

    // send message via SmsAero (available 7 providers)
    $response = $sms->call('SmsAero')->setRecipient('NUMBER')->send('MESSAGE'));

    // get balance of SmsAero account
    $response = $sms->call('SmsAero')->balance();

    // use debug to show headers
    $response = $sms->call('SmsProvider')->debug(true)->setRecipient('NUMBER')->send('MESSAGE'));
    $response = $sms->call('SmsProvider')->debug(true)->balance();


phpunit --configuration phpunit.xml.dist --coverage-text
python
php composer.phar update
php composer.phar install

php composer.phar