What's new

Closed Bulk sms

Status
Not open for further replies.
hmmm ... gawin mo po is query mo ang database table mo na naghohold ng mga phonenumbers then store mo sa array.. then traverse mo ang array foreach record.. then foreach record na itatraverse mo is sesendan mo siya ng sms...

// ------ php code ------
$customers = Customer::all(); // retrieve all customers
$total_customer_count = $customer->count(); // kunin ang total count ng customers
$send_counter = 0; // set counter to 0

$error_numbers = array(); // create array variable;

// isa-isahin ang customer list
foreach($customers as $customer){
$result = SMS::send('Hello', $customer->phonenumber); // send sms

// if sent successfully
if($result){
$send_counter++; // increment ang counter, actually optional kung gusto mo
} else {
$error_number[] = $customer->phonenumber; // if failed ang sending lagay natin sa array ang phonenumber niya
}
}

// if all messages are sent then print sa screen na send lahat
if($total_customer_count === $send_counter){
echo 'All sent successfully';
} else {
// else print natin sa screen ang mga numbers na nagfailed sa sending ....
echo "There was a problem sending on the following numbers:"."<br>";
foreach($error_numbers as $number){
echo $number;
}

}

// ------- end of php code -----------

parang ganyan po ang logic... :)
 
Last edited by a moderator:
hmmm ... gawin mo po is query mo ang database table mo na naghohold ng mga phonenumbers then store mo sa array.. then traverse mo ang array foreach record.. then foreach record na itatraverse mo is sesendan mo siya ng sms...

// ------ php code ------
$customers = Customer::all(); // retrieve all customers
$total_customer_count = $customer->count(); // kunin ang total count ng customers
$send_counter = 0; // set counter to 0

$error_numbers = array(); // create array variable;

// isa-isahin ang customer list
foreach($customers as $customer){
$result = SMS::send('Hello', $customer->phonenumber); // send sms

// if sent successfully
if($result){
$send_counter++; // increment ang counter, actually optional kung gusto mo
} else {
$error_number[] = $customer->phonenumber; // if failed ang sending lagay natin sa array ang phonenumber niya
}
}

// if all messages are sent then print sa screen na send lahat
if($total_customer_count === $send_counter){
echo 'All sent successfully';
} else {
// else print natin sa screen ang mga numbers na nagfailed sa sending ....
echo "There was a problem sending on the following numbers:"."<br>";
foreach($error_numbers as $number){
echo $number;
}

}

// ------- end of php code -----------

parang ganyan po ang logic... :)
naks. bibihira na lang ganito kasipag tumulong
 
Last edited by a moderator:
hmmm ... gawin mo po is query mo ang database table mo na naghohold ng mga phonenumbers then store mo sa array.. then traverse mo ang array foreach record.. then foreach record na itatraverse mo is sesendan mo siya ng sms...

// ------ php code ------
$customers = Customer::all(); // retrieve all customers
$total_customer_count = $customer->count(); // kunin ang total count ng customers
$send_counter = 0; // set counter to 0

$error_numbers = array(); // create array variable;

// isa-isahin ang customer list
foreach($customers as $customer){
$result = SMS::send('Hello', $customer->phonenumber); // send sms

// if sent successfully
if($result){
$send_counter++; // increment ang counter, actually optional kung gusto mo
} else {
$error_number[] = $customer->phonenumber; // if failed ang sending lagay natin sa array ang phonenumber niya
}
}

// if all messages are sent then print sa screen na send lahat
if($total_customer_count === $send_counter){
echo 'All sent successfully';
} else {
// else print natin sa screen ang mga numbers na nagfailed sa sending ....
echo "There was a problem sending on the following numbers:"."<br>";
foreach($error_numbers as $number){
echo $number;
}

}

// ------- end of php code -----------

parang ganyan po ang logic... :)
hmmm ... gawin mo po is query mo ang database table mo na naghohold ng mga phonenumbers then store mo sa array.. then traverse mo ang array foreach record.. then foreach record na itatraverse mo is sesendan mo siya ng sms...

// ------ php code ------
$customers = Customer::all(); // retrieve all customers
$total_customer_count = $customer->count(); // kunin ang total count ng customers
$send_counter = 0; // set counter to 0

$error_numbers = array(); // create array variable;

// isa-isahin ang customer list
foreach($customers as $customer){
$result = SMS::send('Hello', $customer->phonenumber); // send sms

// if sent successfully
if($result){
$send_counter++; // increment ang counter, actually optional kung gusto mo
} else {
$error_number[] = $customer->phonenumber; // if failed ang sending lagay natin sa array ang phonenumber niya
}
}

// if all messages are sent then print sa screen na send lahat
if($total_customer_count === $send_counter){
echo 'All sent successfully';
} else {
// else print natin sa screen ang mga numbers na nagfailed sa sending ....
echo "There was a problem sending on the following numbers:"."<br>";
foreach($error_numbers as $number){
echo $number;
}

}

// ------- end of php code -----------

parang ganyan po ang logic... :)
salamat po :)
Sir may system ka na nito?
 
Last edited by a moderator:
Status
Not open for further replies.

Similar threads

Back
Top