dimanche 5 avril 2015

multiple sms gets for multiple outlets having same order id for a single person

i have a shopping car where a person added two different items of two different outlets having same orderid my database structure is like product added table



order_id email item_id
150405 xyz@gmail.com abc
150405 xyz@gmail.com pqr


outlet details having item_id



outlet_name item_id
beauty_spa abc
pawani_health_care pqr


now my question is how to send two different sms of having different otlet_name to that person(xyz@gmail.com). my sms API which is used to send sms is



//sms api start//
//Multiple mobiles numbers seperated by comma
$mobileNumber = +91xxxxxxxxxx;



//Sender ID,While using route4 sender id should be 6 characters long.
$senderId = "Axxxxx";

//Your message to send, Add URL endcoding here.
$message = urlencode("Dear,xxxxxxxxxxxxxxxxxxxxx.");

//Define route
$state = "4";
//Prepare you post parameters
$postData = array(
'senderID' => $senderId,
'receipientno' => $mobileNumber,
'msgtxt' => $message,
'state' => $state
);

//API URL
$url="http://ift.tt/1DOdbcl";

// init the resource
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postData
//,CURLOPT_FOLLOWLOCATION => true
));

//get response
$output = curl_exec($ch);

curl_close($ch);


//sms api close


please make it a loop so that it continue for two times to send sms to same person with two sms having two different outlets...thank you in advance....i know its little bit tricky....


Aucun commentaire:

Enregistrer un commentaire