Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twilio SMS: Facilitating a group SMS

Tags:

sms

twilio

I'm building an emergency response app for my company. I have a corporate email database, with everyone's mobile numbers, email addresses and hundreds of email groups defined. The goal is to build something that integrates with our maintained groups.

Proposed flow:

  1. Users sends an email to [goupname]@mydomain.com with subject '*text'.
  2. Mailbox Listener picks that up on the server, looks in the group for all members and retrieves their phone numbers.
  3. Server sends a Twilio SMS message to everyone in the group, using their phone number.
  4. Anyone in that group who replies vis SMS to that message, sends to the entire group.
  5. I want my listener out of the picture at this point. From here on, it's just a pure group text, phone to phone(s).

All of this is pretty easy for me, except the Twilio piece.

As you can see, the server/Twilio has a limited role. It's really just a gateway that allow us to use our vast list of groups for group SMS. Is this doable with Twilio? I see many examples of iterating through a list of numbers with a FOR loop, but those replies are going back to my SMS# I believe, and my Twilio number is still going to be involved in the replies. I want to start the group SMS, then have no further role.

Any thoughts/suggestions would be appreciated.

like image 268
MIke McP Avatar asked Nov 01 '14 14:11

MIke McP


People also ask

Can Twilio send group SMS?

Ready to incorporate group texting into your business communications? Get started with the Twilio Conversations API. On top of group texting, you can scale your communications with a single API to include multiparty conversations across SMS, MMS, WhatsApp, and chat.

Can you SMS to a group?

Go to your contacts and create a group of recipients. You can have several groups and name them accordingly. While group messages are an easy way to send a text message, the limit on the number of recipients can be a problem. Plus, since they're sent as MMS, not all phones may support group messages.

Can Twilio send SMS to multiple numbers?

How it works: User specifies a list of phone numbers they would like messages forwarded to while setting up the app. All messages sent to their Twilio phone number will be sent to that list of phone numbers.


1 Answers

I'm a Twilio developer evangelist. Would love to help out here.

That all sounds fine to me. It is certainly the case that in order to send your first group SMS in your example that you'd need to iterate over the list of numbers and send an SMS to each of them from your Twilio number. That text would appear to come from your Twilio number to the end user. If they were to respond to the SMS, you could then have your Twilio number receive it and send a webhook to your server that then sends messages on to everyone else on the list.

It would have to work that way because SMS messaging is inherently one to one. So, in order to blast messages to the entire group, you would need to send a message to a central (Twilio) number.

I hope this helps. Drop me an email at philnash [at] twilio.com if you want to talk through this more.

[edit]

Twilio now supports native group messaging. It has some caveats, because group messaging requires MMS, this only works in countries where Twilio supports MMS, which is the USA and Canada. But it works now! Read the blog post to find out more.

like image 72
philnash Avatar answered Dec 24 '22 13:12

philnash