PHP code example of netlabs / sms-gateway-bundle

1. Go to this page and download the library: Download netlabs/sms-gateway-bundle 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/ */

    

netlabs / sms-gateway-bundle example snippets


new NetLabs\SMSGatewayBundle\NetLabsSMSGatewayBundle()

$smsService = $this->get('net_labs_sms');

$message = $smsService->compose()
    ->setReceiver('123123123')
    ->setContent('This is a test message.');

$result = $smsService->send($message);

$smsService = $this->get('net_labs_sms');

$message = $smsService->compose()
    ->setReceiver('123123123')              // receiver's phone number
    ->setContent('This is a test message.') // message content
    ->setSenderName('Test Name');           // max 11 chars
    ->setIsFlash(false)                     // send as flash message - directly to the screen
    ->setIsWapPush(false)                   // send as WapPush message
    ->setIsUTF8(false)                      // set encoding to utf8, so you can use for example polish characters (ąśćźńęółż)
    ->setIsVCard(false)                     // send as VCard message
    ->setSentAt(new \DateTime('+1 hour'))   // set date for delayed delivery
    ->setUsmsid(uniqid());                  // custom unique message ID

$result = $smsService->send($message);

$smsService = $this->get('net_labs_sms');

$messages = $smsService->receive();

$smsService = $this->get('net_labs_sms');

$reports = $smsService->getReports();

$smsService = $this->get('net_labs_sms');

$counters = $smsService->getCounters();

$smsService = $this->get('net_labs_sms');

$result = $smsService->hlr('123123123');