PHP code example of ereminmdev / yii2-unisender

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

    

ereminmdev / yii2-unisender example snippets


$response = Yii::$app->get('unisender')->sendSms([
    'phone' => $phone,
    'sender' => $sender,
    'text' => $text,
]);

if ($response && $response->isOk) {
    ...
} else {
    ...
}

$data = $sender->processResponse($sender->sendSms([
    'phone' => $phone,
    'sender' => Yii::$app->params['sender.sms.sender'],
    'text' => $text,
]));