Skip to content
No description or website provided.
CoffeeScript CSS Ruby JavaScript
Find file
Failed to load latest commit information.
app
config
lib
.gitignore init Feb 12, 2014
Gemfile
Gemfile.lock init Feb 12, 2014
MIT-LICENSE init Feb 12, 2014
README.md make calling the app optional so you have full control Apr 25, 2014
Rakefile init Feb 12, 2014
zendesk_ticket.gemspec update rails Oct 6, 2014

README.md

Zendesk Ticket

A widget to send tickets to your companies zendesk. No OAuth, login once and send additional metadata in the ticket like the user agent, url and resolution.

Use this on for instance an acceptance server. A client (which you registered) can leave feedback without letting him go through the trouble of authenticating with oauth. The developer doesn't have to register a new app or app domain, he only have to set up zendesk and the token once.

Because you use the api token to authenticate the user, there is a minor security issue, where client of product A could leave feedback on product B if he knows the acceptance url of product B.

Installation

Include the gem in your Gemfile

gem 'zendesk_ticket', git: 'https://github.com/wirelab/zendesk_ticket.git'

Bundle the Gemfile

bundle install

Setup Zendesk

Create an account at zendesk and visit https://YOUR_COMPANY.zendesk.com/agent/#/admin/api

Check 'access with token' and write down the API-token

Configuring

To generate an intializer and translation files, run

rails generate zendesk_ticket:install

Add the following to your environment:

Add to your application.css:

/*
 * require zendesk_ticket
 */

To your application.js:

//= require zendesk_ticket

In your html

  <%= render "zendesk_ticket/popup" %>
  <%= render "zendesk_ticket/button" %>

If you want to use a custom button to call the popup, you can leave out the zendesk_ticket/button partial and add data-zendesk-ticket-button to your button.

Then somewhere in a js file or view you call the app

$(document).ready(function(){
  app = new ZendeskTicketApp;
  app.initialize();
});

Optional:

Instead of posting the form your app, you can post it to a remote website (if you for instance want a centralized server for handeling the data). If this is the case, set the following ENV variable:

  • ZENDESK_REMOTE_FORM_URL 'https://YOUR_COMPANY.com/'

Make sure you set up the CORS right. In a future milestone, I'll look into JSONP, making the CORS not needed.

License

This project rocks and uses MIT-LICENSE.

Something went wrong with that request. Please try again.