class SalesforceBulkAPINotifier::SlackService

Public Class Methods

new() click to toggle source
# File lib/salesforce_bulkapi_notifier/slack_service.rb, line 3
def initialize
  Slack.configure do |config|
    config.token = SalesforceBulkAPINotifier.slack_api_token
  end
  @slack ||= Slack::Web::Client.new
  @slack.auth_test
end

Public Instance Methods

notify(channels, text) click to toggle source
# File lib/salesforce_bulkapi_notifier/slack_service.rb, line 11
def notify(channels, text)
  channels.split(',').each do |channel|
    @slack.chat_postMessage(channel: "#{channel}", text: "#{text}", as_user: true)
  end
end