R/slack.R

Defines functions s_webhook slack

Documented in slack

s_webhook <- function() {
  Sys.getenv("SLACK_WEBHOOK", "X")
}

#' slack
#' @param txt a
#' @export
slack <- function(txt) {
  httr::POST(
    url = s_webhook(),
    encode = "json",
    body = list(
      text = txt
    )
  )
}
folkehelseinstituttet/fd documentation built on March 3, 2020, 12:23 p.m.