Use Twilio to create SMS notifications to keep your subscribers in the loop.
git clone git@github.com:TwilioDevEd/marketing-notifications-sinatra.git
cd marketing-notifications-sinatra
bundle
You can find AccountSID
and the AuthToken
at https://www.twilio.com/user/account/settings.
export TWILIO_ACCOUNT_SID=your account sid
export TWILIO_AUTH_TOKEN=your auth token
export TWILIO_NUMBER=your twilio number
Make sure you have installed PostgreSQL. If on a Mac, I recommend Postgres.app. Given that, we'll use a rake task to generate the database used by the app. You just need to provide a valid user with permission to create databases.
bundle exec rake createDb[user_name]
bundle exec rake spec
ruby app.rb
We can use ngrok for this purpose.
ngrok http 4567
Go to your dashboard on Twilio. Click on Twilio Numbers and choose a number to setup. On the phone number page enter the address provided by ngrok into the Messaging Request URL field.
By now your application should be up and running at http://localhost:4567/. Now your subscribers will be able to text your new Twilio number to Subscribe to your Marketing Notifications Service.
Congratulations!
This application uses this Twilio helper library:
- twilio-ruby
Please visit these libraries and pay your respects.