Skip to content
This repository has been archived by the owner on Dec 25, 2020. It is now read-only.
/ sms_notification Public archive

Send bulk SMS from Slack using Twilio / Receive SMS on Slack using Twilio

License

Notifications You must be signed in to change notification settings

soetani/sms_notification

Repository files navigation

Send bulk SMS from Slack using Twilio
Receive SMS on Slack using Twilio

CircleCI

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

sample

How to use

Because config/settings.yml needs to be modified, deploy to Heroku button is not available.

1. Set up Twilio

  1. Sign up for Twilio (Provides API for SMS)
  2. Get ACCOUNT SID
    This will be TWILIO_ACCOUNT_SID
  3. Get AUTH TOKEN
    This will be TWILIO_AUTH_TOKEN
  4. Get a number
    This will be TWILIO_NUMBER

2. Set up Slack

  1. Create incoming webhook (This allows to receive message on Slack.)
    This will be SLACK_WEBHOOK_URL

3. Duplicate repository

  1. Duplicate this repository to your account.
    Because config/settings.yml needs to be modified and forked repository always remains public, please duplicate the repository.
    See: Duplicating a repository - GitHub

4. Modify config/settings.yml

  1. Update contact in config/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"

5. Deploy to Heroku

  1. Deploy the app to Heroku (The app doesn't use database.)
    Your app name will be used later.
  2. Add ruby to Buildpacks
  3. Add config vars
    • TWILIO_ACCOUNT_SID: See step 1-2
    • TWILIO_AUTH_TOKEN: See step 1-3
    • TWILIO_NUMBER: See step 1-4
    • SLACK_WEBHOOK_URL: See step 2-1
  4. Restart the dyno

6. Set up Slack (One more time)

  1. Create outgoing webhook (This allows to send message from Slack.)
    Trigger Word: sms
    If you change the trigger word, please update outgoing.messages.slack_trigger_word in config/settings.yml.
    URL: https://your-heroku-app.herokuapp.com/api/v1/outgoing/messages
    See your Heroku app name at step 5-1.

7. Set up Twilio (One more time)

  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.

License

The app is released under the MIT License.

About

Send bulk SMS from Slack using Twilio / Receive SMS on Slack using Twilio

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published