Twilio告诉我Error - 52182 Messaging Service not specified,所以即使我认为自己做到了,我显然也不知道该如何具体化。Twilio调试器的主体说Messaging service SID must be specified到目前为止,我还没有找到任何对您有所帮助的东西,因此,我提出了一个问题。Twilio文档也是如此。$recipients = [];foreach ($userIds as $userId) { $user = Craft::$app->users->getUserById($userId); $number = !empty($user->mobil); if ($number) { try { $number = $twilio->lookups->v1->phoneNumbers($user->mobil)->fetch(['countryCode' => 'NO'])->phoneNumber; $recipients[] = '{"binding_type":"sms", "address":"'.$number.'"}'; } catch (\Exception $e) { continue; } }}$twilio = new Client('xxx', 'xxx');$service = $twilio->notify->v1->services->create();$twilio->notify->services($service->sid) ->notifications->create([ "toBinding" => $recipients, "body" => $body ]);我以为我在这里指定了服务sid $twilio->notify->services($service->sid),但显然不是。以前,我会一次循环发送一个SMS,但是由于订阅者列表的增加,该时间超时了。
1 回答
- 1 回答
- 0 关注
- 117 浏览
添加回答
举报
0/150
提交
取消