How to send notifications to slack from ruby / rails
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

How to post to a Slack channel from your Ruby/Rails backend

Setup & usage

  1. Copy the 35 lines small, self explaining 'SlackNotifier' class and use it as follows
  2. Go to:, add the app to your slack team, setup the webhooks default channel and copy your webhook url
  3. You are ready to post! Use the class as follows:
# Initialize
# this notifier posts to your default channel which you setup in step 2)
notifier = "YOUR-URL"
# or send to another channel with a username and icon
notifier = "YOUR-URL", "#channel", "username", ":ghost:"

# send a message, returns a boolean
notifier.send 'Fancy text containing a cool link: <|Try me>'