alexeevdv/yii2-sms-ru

Yii2 wrapper for sms.ru API

Installs: 19 253

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 3

Open Issues: 0

Type:yii2-extension

dev-master 2017-11-28 14:27 UTC

This package is auto-updated.

Last update: 2024-04-29 02:48:42 UTC


README

Yii2 wrapper for sms.ru API

Installation

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require alexeevdv/yii2-sms-ru "dev-master"

or add

"alexeevdv/yii2-sms-ru": "dev-master"

to the require section of your composer.json file.

Configuration

Through application component

"components" => [
    //...
    "sms" => [
        "class" => "alexeevdv\sms\ru\Client",
        "api_id" => "YOUR_API_ID",
    ],
    //...
],

Usage

use alexeevdv\sms\ru\Sms;
$response = \Yii::$app->sms->send(new Sms([
    "to" => "+9530000000",
    "text" => "Hello my friend!",
]));

echo $response->code;