Created
October 17, 2016 13:57
-
-
Save tomrandle/2ba93b2399dd9b15e3e2c8246a7ebf54 to your computer and use it in GitHub Desktop.
triggerSlackRequest
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
function triggerSlackRequest(channel, msg) { | |
var slackWebhook = "YOUR PERSONAL SLACK TOKENIZED URL"; | |
var payload = { "channel": channel, "text": msg, "link_names": 1, "username": "lunchbot", "icon_emoji": ":hamburger:" }; | |
var options = { "method": "post", "contentType": "application/json", "muteHttpExceptions": true, "payload": JSON.stringify(payload) }; | |
Logger.log(UrlFetchApp.fetch(slackWebhook, options)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment