Skip to content

Instantly share code, notes, and snippets.

@mountaindude
Created December 7, 2015 12:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mountaindude/b83e3658d1b07ab05976 to your computer and use it in GitHub Desktop.
Save mountaindude/b83e3658d1b07ab05976 to your computer and use it in GitHub Desktop.
/*
General format:
curl -X POST --data-urlencode 'payload={"channel": "#sense-notification", "username": "webhookbot", "text": "This is posted to #sense-notification and comes from a bot named sensebot.", "icon_emoji": ":ghost:"}' https://hooks.slack.com/services/<....enter_your_key_here....>
Formatting: https://slack.zendesk.com/hc/en-us/articles/202288908-How-can-I-add-formatting-to-my-messages-
More formatting formatting: https://api.slack.com/docs/formatting
Slack API docs: https://api.slack.com/incoming-webhooks
Available emojis: http://www.emoji-cheat-sheet.com/
*/
Sub PostToSlack(vToSlackChannel, vFromUser, vMessage, vIconEmoji)
let vSlackURL = 'https://hooks.slack.com/services/<....enter_your_key_here....>';
execute c:\cygwin64\bin\curl -X POST --data-urlencode 'payload={"channel": "$(vToSlackChannel)", "username": "$(vFromUser)", "text": "$(vMessage)", "icon_emoji": "$(vIconEmoji)"}' $(vSlackURL);
end sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment