PHP code example of sersid / yii2-smsaero

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

    

sersid / yii2-smsaero example snippets


$config = [
    ...
    'components' => [
        ...
        'sms' => [
            'class' => 'sersid\smsaero\SmsAero',
            'user' => 'username',
            //'password' => '*****',
            'api_key' => 'paste_your_api_key' // use api_key or password
            'sender' => 'SMS Aero', // default sender
        ],
    ]
];

Yii::$app->sms->send('798765543210', 'Message'); //@see Send message method

Yii::$app->sms->status(123456);

Yii::$app->sms->balance(); // ['balance' => '30.00']

Yii::$app->sms->senders(); // ['INFORM', 'MY_SENDER', '...']

Yii::$app->sms->sign('new sender');