Twilio Notify Service SMS Bulk with Image

Viewed 355

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.

But the mediaUrl doesn't show up in the received SMS.

mediaUrl dose work with $client->messages->create(); Help ??

1 Answers

Twilio developer evangelist here.

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).

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"]
            ]
    ]);
Related