PHP code example of epmnzava / bulksms

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

    

epmnzava / bulksms example snippets


php artisan vendor:publish --provider="Epmnzava\Bulksms\BulksmsServiceProvider"
 php

use Epmnzava\Bulksms\Bulksms;

class SendSmsController{

public function send_sms(){

$sms=new Bulksms;

$response=$sms->sendMessage("+255679079774","Just testing please receive blessings");

//Your response will look like this

/**{
server_response: "[ { "id" : "953262833859043328", "type" : "SENT", "from" : "PamojaWeCan", "to" : "255679079774", "body" : "hellow man", "encoding" : "TEXT", "protocolId" : 0, "messageClass" : 0, "submission" : { "id" : "2-00000000001865236111", "date" : "2021-03-15T12:06:10Z" }, "status" : { "id" : "ACCEPTED.null", "type" : "ACCEPTED", "subtype" : null }, "relatedSentMessageId" : null, "userSuppliedId" : null, "numberOfParts" : null, "creditCost" : null } ]",
http_status: 201,
error: ""
} 

**/

}

}