How to send sms to multiple users in laravel using nexmo
Hi I want to send sms to users those are existing in my db. I am using nexmo. I have created account in nexmo. I am trying with adding virtual numbers in nexmo account. It's working when I send sms to a single user. But When I add multiple users in "to" section, it throwing error as displayed in the attached image. Before purchasing, I want to test it by sending bulk sms to virtual numbers. Any solutions??
The Nexmo SMS API only accepts a single number at a time in the to
field. You will either have to loop over the list of users you want to send an SMS to
foreach($numbers as $number) {
$client->message()->send([
'to' => $number,
'from' => NEXMO_FROM,
'text' => 'Your message'
]);
}
Or use Nexmo SNS
Nexmo's SMS API can only accept one message per request.
If you need to send out SMS in one batch, you will have to keep the connection alive and reuse the API request for each of the destination numbers. Make sure to keep your connection alive so you can reuse the HTTP socket when sending requests and taking full advantage of your account throughput (30 SMS/second).
链接地址: http://www.djcxy.com/p/33138.html上一篇: 为分类列表设置nexmo测试消息