Sending SMS messages using Textlocal

Author - Maniraj Singh
6.12.2018
|
0 Comments
|

Sending SMS messages using Textlocal

( https://www.textlocal.in/ )

Here is an example to send sms alert using Textlocal account:

There are some mandatory fields to send Sms.

1. Username
2. Hash
3. Message (Enable message template from Textlocal)
4. Number

Create Message Template
Sending SMS messages using Textlocal

After creating message template the message is verified by the Textlocal.

Sometime Sms alert is blocked by textlocal whenever we don’t store the contact information of the user to whom we send the message so to enable it we have to provide the screenshot of the table in which we store the user detail (number,message,datetime) to Textlocal.

Code to send sms alert by using php

$username = "abc@gmail.com";
$hash = "b2407f2be9c51654f7b015aa298eb80b85e8148b2af4d878a950c3617jlle8d";
// Config variables
//$test = "0";
// Data for text message. This is the text message data.
$sender = "WHTSUP"; // This is who the message appears to be from.
$numbers = "8708409909"; // A single number or a comma-seperated list of numbers
$numbers = urlencode('91'.$mobile_number);
$message = "The Best way to Explore your City is here";
// 612 chars or less
// A single number or a comma-seperated list of numbers
$message = urlencode($message);
$data =  "username=".$username."&hash=".$hash."&message=".$message."
&sender=".$sender."&numbers=".$numbers;
$ch = curl_init('http://control.33sms.com/api2/send/?');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch); // This is the result from the API
curl_close($ch);

Test the SMS alert from url

1. http://control.33sms.com/send/?username=abc@gmail.com&hash=hashvalue&numbers=9582223336&sender=AD-WHTS&message=Hello%20abc,%20your%20OTP%20to%20login%20The%20Handlers%20is%20677236

2. Test the sms alert from the Textlocal dashboard by passing the number, message template.

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *