Created
September 10, 2016 21:29
-
-
Save russellpierce/adc05f5ca26a5ae75477ccbd7991b44b to your computer and use it in GitHub Desktop.
Use Zapier to Send a Slack Message
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
#' Send a message to Slack | |
#' | |
#' To use, set options(zapier_slack_webhook="yourZapierPostWebhookHere") | |
#' | |
#' @param message | |
#' @param channel | |
#' @param bot_name | |
#' @param bot_icon_url | |
#' @param image_url | |
#' @param emoji | |
#' | |
#' @return | |
#' @export | |
send_slack_message <- function( | |
message = "", | |
channel = "#testing", | |
bot_name = NULL, | |
bot_icon_url = NULL, | |
image_url = NULL, | |
emoji = NULL | |
) { | |
httr::POST( | |
url = getOption('zapier_slack_webhook'), | |
body = list( | |
message = message, | |
channel = channel, | |
bot_name = bot_name, | |
bot_icon_url = bot_icon_url, | |
image_url = image_url, | |
emoji = emoji), | |
encode = "json") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment