PHP code example of codemonkey76 / laravel-clicksend
1. Go to this page and download the library: Download codemonkey76/laravel-clicksend 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/ */
codemonkey76 / laravel-clicksend example snippets
use Codemonkey76\ClickSend\SmsMessage;
$recipient = '1234567890';
$senderId = '1234567890';
$body = 'Test Message';
$message = new SmsMessage($recipient, $senderId, $body);
$response = ClickSend::SendMessage($message);
// Some time later, get the receipt.
sleep(5);
ClickSend::GetMessageReceipt($response->data->messages[0]->message_id);
use Codemonkey76\ClickSend\SmsMessage;
$message1 = new SmsMessage('1234567890', '1234567890', 'Test Message #1');
$message2 = new SmsMessage('1234567890', '1234567890', 'Test Message #2');
$message3 = new SmsMessage('1234567890', '1234567890', 'Test Message #3');
$message4 = new SmsMessage('1234567890', '1234567890', 'Test Message #4');
$response = ClickSend::SendMessage([$message1, $message2, $message3, $message4]);
// Some time later, get the receipts.
sleep(5);
$receipt1 = ClickSend::GetMessageReceipt($response->data->message[0]->message_id);
$receipt2 = ClickSend::GetMessageReceipt($response->data->message[1]->message_id);
$receipt3 = ClickSend::GetMessageReceipt($response->data->message[2]->message_id);
$receipt4 = ClickSend::GetMessageReceipt($response->data->message[3]->message_id);