Permalink
Browse files

Adding readme and updating app

  • Loading branch information...
1 parent 2be0cde commit 6123da7277258d0d01d444d550cc6619a600f38c @avinasha committed May 1, 2012
Showing with 22 additions and 2 deletions.
  1. +21 −1 README
  2. +1 −1 app.rb
View
22 README
@@ -1 +1,21 @@
-Web Hook To Campfire
+SupportBee Web Hook To Campfire
+
+Adding campfire support to SupportBee is very using SupportBee's web hook feature. Fork this repo and host it on heroku to get going.
+
+h1. Setting up Campfire configuration
+
+You can setup your campfire account by setting specific ENV variables on heroku
+
+``
+$ heroku config:add MARVIN_CAMPFIRE_ACCOUNT="<campfire_subdomain>"
+$ heroku config:add MARVIN_CAMPFIRE_TOKEN="<campfire_token>"
+$ heroku config:add MARVIN_CAMPFIRE_ROOM_IDS="<campfire_room_id>"
+``
+
+Once you push the app to heroku, add the following URL in the web hook screen of supportbee
+
+``
+http://<heroku_app_url>/supportbee
+``
+
+A campfire notification will be sent every time there is a new ticket.
View
2 app.rb
@@ -10,7 +10,7 @@ class App < Sinatra::Base
post '/supportbee' do
json = JSON.parse(request.body.read.to_s)
payload = json['payload']
- if payload['action_type'] == 'ticket_created'
+ if payload['action_type'] == 'ticket.created'
speech = "[#{payload['company']['name']}:New Ticket] #{payload['ticket']['subject']}\n https://#{payload['company']['subdomain']}.supportbee.com/tickets/#{payload['ticket']['id']}"
CAMPFIRE.speak speech
end

0 comments on commit 6123da7

Please sign in to comment.