SMS

17 views
Skip to first unread message

rjclardy

unread,
Mar 3, 2011, 5:23:41 PM3/3/11
to sinatrarb
Long time reader, first time poster...

Does anyone have any experience sending/receiving SMS messages with
Sinatra? Or with ruby on some other framework? If so, do you have any
advice or could you point me to any good info?

I apologize for the non-specific question but I just wanted to poll
the group for any advice before I really get started.

Thanks!

Chris Schneider

unread,
Mar 4, 2011, 10:01:36 AM3/4/11
to sina...@googlegroups.com
Look into Twilio. The ruby to send a message is dead simple using their gem:


def send_sms
account = Twilio::RestAccount.new(TWILIO_ACCOUNT_ID, TWILIO_ACCOUNT_TOKEN)

recipients.each do |r|

opts = {
:To => r.phone_number,
:From => FROM_NUMBER,
:Body => self.message
}

resp = account.request("/#{API_VERSION}/Accounts/#{TWILIO_ACCOUNT_ID}/SMS/Messages",
'POST', opts)
end
end

> --
> You received this message because you are subscribed to the Google Groups "sinatrarb" group.
> To post to this group, send email to sina...@googlegroups.com.
> To unsubscribe from this group, send email to sinatrarb+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sinatrarb?hl=en.
>

rjclardy

unread,
Mar 7, 2011, 7:26:30 PM3/7/11
to sinatrarb
Thanks, I'll definitely look into it

On Mar 4, 9:01 am, Chris Schneider <ch...@christopher-schneider.com>
wrote:
Reply all
Reply to author
Forward
0 new messages