Skip to content

Instantly share code, notes, and snippets.

@ryw
Created February 8, 2015 02:01
Show Gist options
  • Save ryw/b1d80bfa2276b03c825f to your computer and use it in GitHub Desktop.
Save ryw/b1d80bfa2276b03c825f to your computer and use it in GitHub Desktop.
Adding Slack chat from your Meteor App
{
"slack": {
"url": "https://hooks.slack.com/services/XXXXXXXX/XXXXXX/XXXXXXXXXXXXXXXXXX"
}
}
class @Slack
@notify: (text) ->
if process.env.NODE_ENV is "production"
Job.push new SlackJob text: text
class SlackJob extends Job
handleJob: ()->
HTTP.post Meteor.settings.slack.url,
data:
channel: "#useractivity"
username: "The App"
text: @params.text
icon_url: "https://usercycle.com/img/icon.png"
link_names: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment