PHP code example of didiroesmana / phalcon-sms-service

1. Go to this page and download the library: Download didiroesmana/phalcon-sms-service 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/ */

    

didiroesmana / phalcon-sms-service example snippets


		'smsService' => [
			'use' => 'Nexmo',
			'Nexmo' => [
		    		'api_key' => env('NEXMO_API_KEY','YOUR NEXMO API KEY'),
		    		'api_secret' => env('NEXMO_API_SECRET','API_SECRET'),
		    		'endpoint' => 'https://rest.nexmo.com/sms/json',
			],
			'Clickatell' => [
                'token' => env('CLICKATELL_TOKEN', 'YOUR CLICKATELL TOKEN'),
                'endpoint' => 'https://platform.clickatell.com/messages',
            ],
    	],
    

    	$di->setShared('sms', \Didiroesmana\SMSService\Service::class);
    

			// first parameter is sender
			// second is the recipient number
			// third is the message
			dump($this->sms->send('DDGEMES','69696969696969','ANU DD GEMESH'));
        

                dump($this->sms->send('DDGEMES',['+62xxxx','+62xxxxx','+1xxxxxx' ...]));
		

$this->sms->changeProvider('Clickatell')->send(...);