简体   繁体   中英

Twilio Sending multiple sms on same number instead of multiple numbers

Hello i am using twilio in my project builted on laravel framework. Its stated in twilio site that "For sending sms to multiple number you need to add all numbers in an array and make seperate call for each number using iteration". I am doing the same but its till sending multiple message to only first number instead of sending sms to multiple numbers. here is my code.

foreach ($numbers as $number) {
Twilio::sms(['to' => [$number],'message' => 'Hi']);
 }

$numbers Contains two numbers +9234222***** and +9231102***** But i am recieving two messages on +9234222***** instead of one on each. And in my twilio dashboard its showing 2 segments for +9234222***** and +9231102***** is not there.

UPDATE I have found the solution for sending same message to multiple numbers . for sending sms to multiple numbers simply pass the array $numbers in 'to' instead of loop. Twilio::sms(['to' => $numbers,'message' => 'Hi']);

Still waiting for best answer. What if i want to send message with Name. eg 'Hi John' on +9234222***** and 'HI Doe' on +9231102*****.

Note: I am using https://github.com/j42/laravel-twilio

UPDATE I have found the solution for sending same message to multiple numbers . for sending sms to multiple numbers simply pass the array $numbers in 'to' instead of loop. Twilio::sms(['to' => $numbers,'message' => 'Hi']);

Still waiting for best answer. What if i want to send message with Name. eg 'Hi John' on +9234222***** and 'HI Doe' on +9231102*****

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM