f_send_slack_comment: Send Slack Comment.

View source: R/f - Send slack comment.R

f_send_slack_commentR Documentation

Send Slack Comment.

Description

Sends Slack comment.

Usage

f_send_slack_comment(
  c.slack.hook,
  c.marker,
  c.title,
  c.message.main,
  v.message.list,
  v.button.txt,
  v.button.url,
  c.image.url = NULL
)

Arguments

c.slack.hook

String with slack hook.

c.marker

String to code the marker: 'v' for checkbox and 'x' for white cross.

c.title

Title of message (string).

c.message.main

Main message (string).

v.message.list

Message to communicate (vector with strings).

v.button.txt

Text labels on the buttons (vector with strings).

v.button.url

URL behind the buttons (vector with strings).

c.image.url

Link to image to show in Slack message (default NULL).

Details

How to obtain a Slack Hook:

* Go to https://api.slack.com/apps

* If needed, create a new app

* Go to ‘Incoming Webhooks’

* If not already, activate Incoming Webhooks

* Add new webhook to workspace

* Select channel

* Copy webhook and use for POST() function.

* Add app to Slack by ‘Add apps’, or the channel may already be pointing to it for you

Value

None

Author(s)

Pieter Overdevest

Examples

f_send_slack_comment(
       c.slack.hook   = "https://hooks.slack.com/services/........./......../...........",
       c.marker       = "xxx",
       c.title        = "A greate title!",
       c.message.main = "The main message.",
       v.message.list = c("Hello World!", "This is item 2", "And a third item"),
       v.button.txt   = c('Dumps', 'Log', 'RDS', 'IPSm'),
       v.button.url   = c(c.ipsm.dumps, c.ipsm.allocatie.log, c.data.repo, "https://ipsm.nl/"),
       c.image.url    = "https://media.licdn.com/dms/image/C560BAQEGsMeS8zRHcg/company-logo_200_200/0/1612876167821?e=1682553600&v=beta&t=ypO6V4vhFioktDnqLdCKra0K6IGaI2bl6klfHaxA0lw"
)

pieterov/generaltoolbox documentation built on Jan. 25, 2025, 10:32 a.m.