https://github.com/qnester/hey-you-slack
Slack notification channel for hey-you gem
https://github.com/qnester/hey-you-slack
Last synced: 8 months ago
JSON representation
Slack notification channel for hey-you gem
- Host: GitHub
- URL: https://github.com/qnester/hey-you-slack
- Owner: QNester
- Created: 2019-04-08T13:57:25.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-07-05T12:01:17.000Z (almost 6 years ago)
- Last Synced: 2025-06-13T07:46:23.974Z (12 months ago)
- Language: Ruby
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Hey, You, Slack!
[](https://travis-ci.com/QNester/hey-you-slack#)
[](https://badge.fury.io/rb/hey-you-slack)
Slack notifications via [hey-you gem](https://github.com/QNester/hey-you).
## Installation
Add this line to your application's Gemfile:
```ruby
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](https://github.com/QNester/hey-you).
For example:
```yaml
# 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:'
```
```ruby
# 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
```
```ruby
# // 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`.