A Rails app to send and receive SMS using Twilio and Slack.
The app is suitable for sending messages to your employees or team members.
e.g. emergency alert, event alert
You can:
- Send same message to people in contact list of
config/settings.yml
from Slack using Twilio - Receive SMS on Slack using Twilio
Because config/settings.yml
needs to be modified, deploy to Heroku button is not available.
- Sign up for Twilio (Provides API for SMS)
- Get ACCOUNT SID
This will beTWILIO_ACCOUNT_SID
- Get AUTH TOKEN
This will beTWILIO_AUTH_TOKEN
- Get a number
This will beTWILIO_NUMBER
- Create incoming webhook (This allows to receive message on Slack.)
This will beSLACK_WEBHOOK_URL
- Duplicate this repository to your account.
Becauseconfig/settings.yml
needs to be modified and forked repository always remains public, please duplicate the repository.
See: Duplicating a repository - GitHub
- Update
contact
inconfig/settings.yml
.
People in contact will be receive SMS when you send message on Slack.
contact:
-
nickname: John
phone: "+11234567890"
-
nickname: Taro
phone: "+819012345678"
-
nickname: Nguyen
phone: "+84123456789"
- Deploy the app to Heroku (The app doesn't use database.)
Your app name will be used later. - Add
ruby
to Buildpacks - Add config vars
TWILIO_ACCOUNT_SID
: See step 1-2TWILIO_AUTH_TOKEN
: See step 1-3TWILIO_NUMBER
: See step 1-4SLACK_WEBHOOK_URL
: See step 2-1
- Restart the dyno
- Create outgoing webhook (This allows to send message from Slack.)
Trigger Word:sms
If you change the trigger word, please updateoutgoing.messages.slack_trigger_word
inconfig/settings.yml
.
URL:https://your-heroku-app.herokuapp.com/api/v1/outgoing/messages
See your Heroku app name at step 5-1.
- Set up Messaging webhook (This allows to receive message on Slack.)
Visit here and click the number to set up webhook.
Messaging => A MESSAGE COMES IN =>
Webhook /https://your-heroku-app.herokuapp.com/api/v1/incoming/messages
/ HTTP POST
See your Heroku app name at step 5-1.
The app is released under the MIT License.