View source: R/mlr_messenger.R
These functions make it simple to send a message to and from either Slack using the https://github.com/hrbrmstr/slackr package, or for Hipchat using the https://github.com/robertzk/hipchat package. You can set the criteria for whether the function should send a Success or Error message to a room of your choosing. No extra env variables are needed as it works of the existing config for the packages mentioned above.
1 2 3 | mlr_messenger(app = "Hipchat", channel = "AppChat", success_flag = status,
success_value = TRUE, success_message = "Success!",
fail_message = "Failed!")
|
app |
- Can be either 'Hipchat' or 'Slack' #' @param channel - the room to send to. No need for # prefix on room name if using Slack |
success_flag |
- Can be a variable already pre-stored in your script. To use an existing value, make sure to leave it unquoted when passing to the function |
success_value |
- How will the fuction know to send a Success or Error message? Uses this value and evaluates it against success_flag. |
success_message |
- The message to send if success_flag == success_value |
fail_message |
- The message to send if success_flag != success_value |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.