Skip to content

Instantly share code, notes, and snippets.

@freerangeeggs
Created October 12, 2016 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freerangeeggs/5f25518ac17336c3e9e27b68e9426ad6 to your computer and use it in GitHub Desktop.
Save freerangeeggs/5f25518ac17336c3e9e27b68e9426ad6 to your computer and use it in GitHub Desktop.
var request = require('request');
if(data) {
var slackUrl = "<YOUR SLACK URL>";
var text = {
"text": "Something happened!!\n<" + data.context.portalLink + "|Check it out>"
};
var requestData = {
url: slackUrl,
method: "POST",
json: true,
headers: {
"content-type": "application/json",
},
body: text
};
request(requestData);
context.res = {
status: 200
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment