Skip to content

Send to Slack (webhook)

ts
function SendToSlackWebHook(
  webhookURL: string, // required
  message:    string, // required
  sender?:    string, // optional
  icon?:      string  // optional
): boolean;

Posts a notification to a Slack channel using Slack's Incoming WebHooks.

  • webhookURL and message are required.
  • sender is an optional free-text string.
  • icon is an optional emoji name (see the emoji cheat sheet).

Returns true if the notification was successfully posted, or false otherwise.

Example

ts
SendToSlackWebHook(
  'https://hooks.slack.com/services/*****/*******/**************',
  'Some message',
  'Syncplify.me AFT!',
  ':smile:'
);