Sha256: 9044a22efd1f3dee9b81b6211b20affd7b1542c281310eff57701c381f22691f

Contents?: true

Size: 663 Bytes

Versions: 10

Compression:

Stored size: 663 Bytes

Contents

require 'slack-ruby-client'

Slack.configure do |config|
  config.token = ENV['SLACK_API_TOKEN']
  raise 'Missing ENV[SLACK_API_TOKEN]!' unless config.token
end

client = Slack::Web::Client.new

client.auth_test

client.chat_postMessage(
  channel: '#general',
  as_user: true,
  attachments: [
    {
      fallback: "Ticket #1943: Can't reset my password - https://groove.hq/path/to/ticket/1943",
      pretext: 'New ticket from Andrea Lee',
      title: "Ticket #1943: Can't reset my password",
      title_link: 'https://groove.hq/path/to/ticket/1943',
      text: 'Help! I tried to reset my password but nothing happened!',
      color: '#7CD197'
    }
  ]
)

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
slack-ruby-client-0.14.4 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.14.3 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.14.2 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.14.1 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.14.0 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.13.1 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.13.0 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.12.0 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.11.1 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.11.0 examples/new_ticket/new_ticket.rb