A PHP-client-library for using SMS services with yii2 framework.

Installs: 33

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 2

Open Issues: 0


1.0.1 2020-04-17 12:53 UTC

This package is auto-updated.

Last update: 2024-04-17 22:31:04 UTC


A lightweight PHP-client-library for using SMS services with yii2 framework. Reduces the complexity of network-communication between client and SMS gateway, to help save time and money for focusing on their business logic.

Latest Stable Version Total Downloads License


The preferred way to install this extension is through composer.

Either run

$ php composer.phar require --prefer-dist simialbi/yii2-websms-com

or add

"simialbi/yii2-websms-com": "^1.0.0"

to the require section of your composer.json.


In order to use this component, you will need to:

  1. Setup component your application so that the module is available.

Setup component

return [
    // [...]
    'components' => [
        'sms' => [
            'class' => 'simialbi\yii2\websms\Connection',
            'baseUrl' => '',
            'token' => '<your api token>',
            'sendUrl' => '/rest/smsmessaging/simple'

Example Usage

To send a message create a new Message instance and set at least the content and recipients.

 /** @var \simialbi\yii2\websms\Connection $sms */
$sms = Yii::$app->get('sms', true);
$message = $sms->createMessage();
    ->id('my-test-id-' . uniqid())
    ->content("This is a test\nwith multpile lines")
$response = $message->send();

if ($response->isOk) {
    echo 'success';
} else {
    echo 'failure';


yii2-websms-com is released under MIT license. See bundled LICENSE for details.