PHP code example of massimo-filippi / sms-module

1. Go to this page and download the library: Download massimo-filippi/sms-module 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/ */

    

massimo-filippi / sms-module example snippets




return [
    'Zend\Router',
    'Zend\Validator',
    'MassimoFilippi\SmsModule', // Add this line, ideally before Application module.
    'Application',
];



return [
    'massimo_filippi' => [
        'sms_module' => [
            'adapter' => \MassimoFilippi\SmsModule\Adapter\SmsApiCom\SmsApiComAdapter::class,
            'adapter_params' => [
                'api_username' => 'john.doe',
                'api_password_hash' => '1234567890', // MD5 hash of password in case of SMSApi
            ],
        ],
    ],
];


 

use MassimoFilippi\SmsModule\Message\Message as SmsMessage;

$smsMessage = new SmsMessage();

$smsMessage->setTo('00420123456789');
$smsMessage->setText('Hello World!');

try {
    // Injected MassimoFilippi\SmsModule\Service\SmsService.
    $this->smsService->sendSMS($smsMessage);
} catch (\Exception $exception) {
    var_dump($exception->getMessage());
}