简体   繁体   English

Twilio通知服务短信批量发送图像

[英]Twilio Notify Service SMS Bulk with Image

Im trying to bulk SMS with the following 我正在尝试使用以下内容批量发送短信

$notification = $client
            ->notify->services($appSid)
            ->notifications->create([
                "toBinding" => $binding,
                "body" => "000000000000000000000000000",
                "mediaUrl" => "https://c1.staticflickr.com/3/2899/14341091933_1e92e62d12_b.jpg"
        ]);

$binding is just an array of phone numbers. $ binding只是电话号码的数组。

But the mediaUrl doesn't show up in the received SMS. 但是mediaUrl不会显示在收到的SMS中。

mediaUrl dose work with $client->messages->create(); mediaUrl使用$ client-> messages-> create(); Help ?? 救命 ??

Twilio developer evangelist here. Twilio开发人员布道者在这里。

When sending media over MMS using Notify you need to specify the media as part of the SMS overrides (see the documentation here on the options you can send when creating a notification ). 使用通知通过MMS发送媒体时,您需要指定媒体作为SMS替代的一部分(请参阅此处文档,了解创建通知时可以发送的选项 )。

So, in your case your code should look like this: 因此,在您的情况下,您的代码应如下所示:

$notification = $client
        ->notify->services($appSid)
        ->notifications->create([
            "toBinding" => $binding,
            "body" => "000000000000000000000000000",
            "sms" => [
                "media_urls" => ["https://c1.staticflickr.com/3/2899/14341091933_1e92e62d12_b.jpg"]
            ]
    ]);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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