Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/*
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