PHP code example of thinkstudeo / laravel-textlocal
1. Go to this page and download the library: Download thinkstudeo/laravel-textlocal 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/ */
Sms::transactional()
->to('911234523451')
->from('SENDER') //Your registered sender
->send('My message'); //as per your approved template
Sms::transactional()
->to('911234523451,919898456456')
->from('SENDER') //Your registered sender
->send('My message'); //as per your approved template
Sms::transactional()
->to(['911234523451', '919898456456'])
->from('SENDER') //Your registered sender
->send('My message'); //as per your approved template
$schedule = "2019-01-01 09:30:00";
Sms::transactional()
->to('911234523451,919898456456')
->at($schedule)
->from('SENDER') //Your registered sender
->send('My message'); //as per your approved template
//Get a list of all the scheduled messages
$response = Account::transactional()->scheduledMessages();
$scheduledMessages = $response->scheduled;
//Identify the scheduled message you want to cancel
$msg = $scheduledMessages[0];
//Cancel the message
Account::transactional()->cancel($msg->id);
Sms::promotional()
->to('911234523451')
->from('TXTLCL') //or Your registered sender
->send('My message');
Sms::promotional()
->to('911234523451,919898456456')
->from('TXTLCL') //or Your registered sender
->send('My message');
Sms::promotional()
->to(['911234523451', '919898456456'])
->from('TXTLCL') //or Your registered sender
->send('My message');
$schedule = "2019-01-01 09:30:00";
Sms::promotional()
->to('911234523451,919898456456')
->at($schedule) //unix timestamp
->from('TXTLCL') //or Your registered sender
->send('My message'); //as per your approved template
//Get a list of all the scheduled messages
$response = Account::promotional()->scheduledMessages();
$scheduledMessages = $response->scheduled;
//Identify the scheduled message you want to cancel
$msg = $scheduledMessages[0];
//Cancel the message
Account::promotional()->cancel($msg->id);
//Capture the message id and or batch id when you send the message
$response = Sms::promotional()->to(['911234523451', '919898456456'])->from('TXTLCL')->send('My Message');
$msgId = $response->messages[1]->id;
$batchId = $response->batch_id;
//Get the status
Account::promotional()->messageStatus($msgId);
//Or
Account::promotional()->batchStatus($batchId);
//Get a list of all inboxes in your account
$inboxList = Account::promotional()->inboxes();
//Identify the inbox you want to fetch the messages from, and get its id
$inboxId = $inboxList[0]->id;
//Fetch the messages from the inbox
$messages = Account::promotional()->messages($inboxId);
//Note the id of the group when you create a new one
$customersId = Account::promotional()->createGroup('Customers')->group->id;
//Or get a list of all groups
$groupList = Account::promotional()->groups();
//Get the id of the group you want to delete
$groupId = $groupList[0]->id;
//Delete the group
$status = Account::promotional()->deleteGroup($customerId);
//Or
$status = Account::promotional()->deleteGroup($groupId);
//Or just give the name of the group to the command
$status = Account::promotional()->deleteGroup('Customers');
//Single message histr=ory
$response = Account::promotional()->history('single');
//Group message history
$response = Account::promotional()->history('group');
//Api message history
$response = Account::promotional()->history('api');
$response = Account::promotional()->surveys();
//Get a list of active surveys
$surveys = Account::promotional()->surveys();
//Identify the survey for which you want the details
$surveyId = $surveys->survey_ids[0]->id;
//Fetch the details
$response = Account::promotional()->surveyDetails($surveyId);
//Get a list of active surveys
$surveys = Account::promotional()->surveys();
//Identify the survey for which you want the results
$surveyId = $surveys->survey_ids[0]->id;
//Fetch the results
$response = Account::promotional()->surveyResults($surveyId);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.