Clay_dropdead
Honorary Poster
- Joined
- Feb 28, 2017
- Posts
- 332
- Reaction
- 206
- Points
- 229
Guys pa help naman about sa bulksms kailangan masend lahat ng laman ng database na mga phone numbers
Gamit ko checkbox array
Gamit ko checkbox array
/* Step 1: retrieve all numbers from database table or lahat ng nakacheckbox
Step 2: then magloop ka po ... kung anong preferred mo
Step 3: Send sms per phone number
Step 4: Check if success or not (dapat meron kang counter kung how many tries)
Step 5: if success store mo sa isang array lahat ng nagsuccess na messages per phonenumber
Step 6: if error store mo rin sa array kung saan meron nagfailed na send.
Step 7: return ka ng report kung saan makikita lahat ng nagfailed then lagay ka button to retry send sa lahat ng nagfailed na phonenumbers.
then repeat all process until lahat magsuccess...
*/
$customers = Customer::all();
$failed = array();
$success = array();
foreach($customers as $customer){ // all customer numbers
$result = false; // set default status as false since hindi pa naman nagsesend
for($cnt = 1; $cnt <= 3; $cnt++){ // pwede wala na to pero depende sa iyo kung may number of tries ka
$result = Sms:send($customer->number,'Hello'); // check if sucess and send or not... depende sa API
if($result == true) { break; } // if true then break from loop.
}
if($result){ // if true then push to success
array_push($success,$customer->number);
} else { // else push to failed list
array_push($failed,$customer->number);
}
}
// then display result in a page... then lagay ka naman button to try sending to those failed numbers. :)
bale parang ganito po gawin mo po...
PHP:/* Step 1: retrieve all numbers from database table or lahat ng nakacheckbox Step 2: then magloop ka po ... kung anong preferred mo Step 3: Send sms per phone number Step 4: Check if success or not (dapat meron kang counter kung how many tries) Step 5: if success store mo sa isang array lahat ng nagsuccess na messages per phonenumber Step 6: if error store mo rin sa array kung saan meron nagfailed na send. Step 7: return ka ng report kung saan makikita lahat ng nagfailed then lagay ka button to retry send sa lahat ng nagfailed na phonenumbers. then repeat all process until lahat magsuccess... */ $customers = Customer::all(); $failed = array(); $success = array(); foreach($customers as $customer){ // all customer numbers $result = false; // set default status as false since hindi pa naman nagsesend for($cnt = 1; $cnt <= 3; $cnt++){ // pwede wala na to pero depende sa iyo kung may number of tries ka $result = Sms:send($customer->number,'Hello'); // check if sucess and send or not... depende sa API if($result == true) { break; } // if true then break from loop. } if($result){ // if true then push to success array_push($success,$customer->number); } else { // else push to failed list array_push($failed,$customer->number); } } // then display result in a page... then lagay ka naman button to try sending to those failed numbers. :)
wala ako sample system sir eh ... basta ang process or flow kung paano magbulk send is yung pinost ko sa taas... tapos sa api naman po is meron kasi kami gsm gateway(openvox) sa office so sa website ng supplier ako kumuha meron kasi sila downloadable api doon. pero kung Saas naman yung provider mo marami naman mga online gsm gateway tapos meron na yan sila api ibibigay sa iyo sa pagsend and receive ng messages.boss patulong may sample system ka nito ano po api n a gamit nyo?
really helpful sir thanks sa logicwala ako sample system sir eh ... basta ang process or flow kung paano magbulk send is yung pinost ko sa taas... tapos sa api naman po is meron kasi kami gsm gateway(openvox) sa office so sa website ng supplier ako kumuha meron kasi sila downloadable api doon. pero kung Saas naman yung provider mo marami naman mga online gsm gateway tapos meron na yan sila api ibibigay sa iyo sa pagsend and receive ng messages.
Edit: basta ang importante lang naman po is ang api mo na ginamit. Subukan mo muna magsend ng sms sa number mo. Then kung nagsuccess, saka ka na po magbulk sms. tska isa pa po pala, meron kasi ibang modem is 155-160 characters lang ang minimum per send so basahin mo lang po ang api documentation ng provider kung anong code ang gagamitin sa more than 160 characters in 1 send lang sa number.