Module: Radesk::HipchatHelper

Included in:
TicketsController
Defined in:
app/helpers/radesk/hipchat_helper.rb

Instance Method Summary collapse

Instance Method Details

#send_notification(ticket) ⇒ Object



3
4
5
6
7
8
9
# File 'app/helpers/radesk/hipchat_helper.rb', line 3

def send_notification(ticket)
  return unless Radesk.hipchat_api_token.present?
  token = Radesk.hipchat_api_token
  message = view_context.link_to(ticket.title, ticket_url(ticket))
  client = ::HipChat::Client.new(token, :api_version => 'v2')
  client[Radesk.hipchat_room].send('', message, :notify => true)
end