probator.plugins.notifiers.slack

class probator.plugins.notifiers.slack.SlackNotifier(api_key=None)

Bases: probator.plugins.notifiers.BaseNotifier

notify(subsystem, recipient, subject, body_html, body_text)

You can send messages either to channels and private groups by using the following formats

#channel-name @username-direct-message

Parameters:
  • subsystem (str) – Name of the subsystem originating the notification
  • recipient (str) – Recipient
  • subject (str) – Subject / title of the notification, not used for this notifier
  • body_html (str) – HTML formatted version of the message
  • body_text (str) – Text formatted version of the message
Returns:

None

static send_message(contacts, message)

List of contacts the send the message to. You can send messages either to channels and private groups by using the following formats

#channel-name @username-direct-message

If the channel is the name of a private group / channel, you must first invite the bot to the channel to ensure it is allowed to send messages to the group.

Returns true if the message was sent, else False

Parameters:
  • contacts (list of str,`str`) – List of contacts
  • message (str) – Message to send
Returns:

bool