A Rails (Ruby) app showing how to implements customer support system over SMS using the Nexmo SMS API.
- A Nexmo account
- Ruby 2.1+ and Bundler installed
# clone this repository
git clone git@github.com:Nexmo/ruby-sms-customer-support.git
# change to folder
cd ruby-sms-customer-support
# install dependencies
bundle install
# create a .env
cp .env.example .env
Next you will need to sign up for a Nexmo account, get your API credentials from the API dashboard, register a SMS number, and put all of these details in your .env
file.
Then you can start the server.
rails server
Finally make sure to link the callback URL for your number to your app. For this you will need a public IP or a tool like ngrok. We highly recommend using the Nexmo CLI to link your number up to the callback URL:
> nexmo link:sms [your_nexmo_number] http://[your.domain.com]/support
Number updated
Once your server is started:
- Visit localhost:3000 on a mobile phone.
- Click the "Get support via SMS" link to open your SMS messaging app.
- Send a SMS to create a new support ticket.
- Your app will receive the incoming message in and respond back to your phone with a confirmation in seconds.
As this is a very simple starter app this app does not provide a way to reply to support requests. This is left as an exercise.
This project is licensed under the MIT license.