Reputation: 3
Please provide direction on sending bulk MMS. I’m wondering if I’m on the right track with the following code - what am I doing wrong? I tried using mms and 'binding_type' and mediaUrl in the but it did not work.
$subscribers = [
json_encode(['binding_type' => "mms", 'address' => "+14085551111"]), json_encode(['binding_type' => "mms", 'address' => "+14084441111"]) ];$request_data = [ ‘toBinding’ => $subscribers, 'body' => ‘Hello World!’, 'mediaUrl' => 'https://myurl.com/mms-image.png' ];
I have successfully used Message/Notify for SMS using Marcus' tutorial here for PHP, but not for MMS: https://www.twilio.com/blog/send-bulk-text-messages-php-timing-out
I can also can send individual MMS, but not in using Notify.
I see that Notify services are being depreciated, but since I am familiar with using SMS for Notify I'd like to see if I can stay on this track for at least the short term.
I found this article on Stack from 2013 for SMS, which indicates that I might need to send 1 message at a time. Is there any guidance on sending multiple MMS? How to send bulk SMS with twilio API
Upvotes: 0
Views: 164
Reputation: 7164
As of October 24, 2022, Twilio Notify is no longer for sale to new customers and it will reach end of life on October 23rd 2023 for existing customers. You can find more guidance regarding Notify's deprecation here.
Twilio does have an alternative to Notify, which I'll talk about in a second. Depending on the type of phone number and some other factors, you are limited to a certain amount of Segments per second. To increase the throughput of segments/second, you can increase the amount of phone numbers you are sending SMS or MMS from.
Instead of you having to decide from which phone number to send SMS/MMS from to maximize throughput, Twilio has Messaging Services. Instead of sending messages directly from a phone number, you add multiple phone numbers or other types of senders, and send the message from the messaging service instead.
Follow these steps. First, create a messaging service, and then, add multiple phone numbers to your service to increase the message throughput. The more phone numbers in your service, the more messages can be sent in parallel. Then grab the Messaging Service SID which you'll need in your code.
Here's how to send an MMS using a messaging service:
$twilio->messages
->create("+441632960675", // to
[
"body" => "Hello World!",
"mediaUrl" => ["https://myurl.com/mms-image.png"] ,
"messagingServiceSid" => "MG9752274e9e519418a7406176694466fa"
]
);
Read the docs on how to use Messaging Service here.
Upvotes: 0