Last active
November 25, 2016 07:57
-
-
Save venetucci/0be7ba53fcf2ee5b160ff921941aca9c to your computer and use it in GitHub Desktop.
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 postTopicNamesResponse(channel, topicNames) { | |
var payload = { | |
"channel": "#" + channel, | |
"username": "Topic List", | |
"icon_emoji": ":grin:", | |
"attachments":[ | |
{ | |
"fallback": "This is an update from a Slackbot integrated into your organization. Your client chose not to show the attachment.", | |
"pretext": "You can use the following topic names: " + topicNames.join(", "), | |
"mrkdwn_in": ["pretext"] | |
} | |
] | |
}; | |
var url = '[INCOMING WEBHOOK URL]'; | |
var options = { | |
'method': 'post', | |
'payload': JSON.stringify(payload) | |
}; | |
return UrlFetchApp.fetch(url,options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment