sersid/yii2-smsaero

Integration of SMS-messages to yii2 application

Installs: 531

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 1

Open Issues: 0

Type:yii2-extension

1.1.0 2021-02-02 06:25 UTC

This package is not auto-updated.

Last update: 2024-11-05 03:23:54 UTC


README

https://smsaero.ru/api/v1/ Integration of SMS-messages to yii2 application

Installation

One

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist sersid/yii2-smsaero "dev-master"

or add

"sersid/yii2-smsaero": "dev-master"

to the require section of your composer.json file.

Two

$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
        ],
    ]
];

Three

Read the documentation http://smsaero.ru/api/

Usage

Once the extension is installed, simply use it in your code by :

Send message

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

Checking the status of the sent message

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

Balance

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

Available senders

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

Request new signature

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