https://github.com/philnash/sms-messages-hanami
An example application for receiving and responding to SMS messages from Twilio in Hanami
https://github.com/philnash/sms-messages-hanami
hanami ruby twilio twilio-api twilio-sms twilio-sms-api
Last synced: 6 months ago
JSON representation
An example application for receiving and responding to SMS messages from Twilio in Hanami
- Host: GitHub
- URL: https://github.com/philnash/sms-messages-hanami
- Owner: philnash
- Created: 2017-11-17T06:10:43.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-22T13:05:09.000Z (almost 8 years ago)
- Last Synced: 2025-02-21T00:09:16.454Z (8 months ago)
- Topics: hanami, ruby, twilio, twilio-api, twilio-sms, twilio-sms-api
- Language: Ruby
- Homepage:
- Size: 14.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Messages
An example of a Hanami app to receive and respond to incoming SMS messages from [Twilio](https://www.twilio.com). You can read about how this was created and the decisions took in the blog post [How to receive and respond to text messages in Ruby with Hanami and Twilio](https://www.twilio.com/blog/2017/11/how-to-receive-and-respond-to-text-messages-in-ruby-with-hanami-and-twilio.html).
## Setup
You'll need a Twilio account, [sign up for a free account here](http://twilio.com/try-twilio), and a phone number that can receive SMS messages.
To tunnel internet traffic to your local development server [I recommend ngrok](https://www.twilio.com/blog/2015/09/6-awesome-reasons-to-use-ngrok-when-testing-webhooks.html).
### Getting started
Clone this repository and install the dependencies:
```bash
git clone https://github.com/philnash/sms-messages-hanami.git
cd sms-messages-hanami
bundle install
```Run the tests:
```
bundle exec rake spec
```Run the development server:
```
bundle exec hanami server
```Run ngrok:
```
ngrok http 2300
```Take the ngrok URL and add the path `/webhooks/sms`. Enter that URL as the messaging webhook for your [Twilio number](https://www.twilio.com/console/phone-numbers/incoming).
Send a message to your number and your application will respond with "Hello from Hanami!".
Explore Hanami [guides](http://hanamirb.org/guides/), [API docs](http://docs.hanamirb.org/docs/1.1.0/), or jump in [chat](http://chat.hanamirb.org) for help. Enjoy! 🌸