-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for dynamic webhooks to be used by Slacked
This commit introduces the ability for a user to set a dynamic webhook url through the use of the `config` parameter to `Slacked#post` and `Slacked#post_async`. By introducing this feature through the `config` parameter, there are no breaking changes with previous versions of Slacked. The behaviour of Slacked is exactly the same as before, where Slacked will use the default `ENV[SLACK_WEBHOOK_URL_KEY]` set in the `.env` file. However, should you want to use `Slacked` to send messages to different webhooks from a single Rails app, you can now do so: ```ruby Slacked.post('My message to the default webhook') # this sends a message to the default webhook url set by `ENV[SLACK_WEBHOOK_URL_KEY]` in the `.env` file Slacked.post('My message to a specific webhook url', { webhook_url: '<SOME_WEBHOOK_URL>'}) # this sends a message to an explicit webhook url ``` The README and tests have been updated accordingly.
- Loading branch information
1 parent
93e8a59
commit 15d927f
Showing
3 changed files
with
27 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters