0.0
No commit activity in last 3 years
No release in over 3 years
This gem extend core gem `hey-you` for send notifications to slack with webhooks.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.9
~> 13.0
~> 3.0
~> 3.4

Runtime

~> 0.16
 Project Readme

Hey, You, Slack!

Build Status Gem Version

Slack notifications via hey-you gem.

Installation

Add this line to your application's Gemfile:

gem 'hey-you-slack'

And then execute:

$ bundle

Or install it yourself as:

$ gem install hey-you-slack

Usage

After load gem you can send notifications to slack via hey-you.

For example:

# config/notifications.yml
events:
  signed_up:
    # ...
    slack:
      username: Greeter
      text: 'User with email %{email} was signed up'
      webhook_name: 'channel_name' # key from config.slack.webhooks
      icon_emoji: ':grin:'
# config/initalizers/hey-you.rb
HeyYou::Config.configure do 
	# [Hash] required - list of slack-webhooks for your applications 
  config.slack.webhooks = {
    channel_name: 'http://webhooks.slack/channel_webhook'
  } 
	
  # [String] optional - default name of author notifications messages in slack chats. 
  config.slack.slack_username = 'MyApp_Notifier'
end
# // somewhere in your app 
builder = Builder.new('events.signed_up', email: created_user.email) 
HeyYou::Channels::Slack.send!(builder) #=> { success: true }
# Notification will be received in slack chat :)

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.