Coder Social home page Coder Social logo

deskjockey's Introduction

Desk Jockey - Custom Zendesk Widget

A custom feedback and support widget for Zendesk.

My company is a two product company and we use a ticket field to separate out our incoming tickets to separate support groups for each one. Because Zendesk's own "Feedback Tab" widget doesn't support passing custom fields, a more flexible solution was needed. This widget serves that purpose for us.

Right now it's a fairly basic, with only a simple iframe widget that goes through some standard server-rendered pages. In the future, it will load things more dynamically and have a much prettier exterior.

Requirements

  • jQuery 1.6 or higher in the app containing the widget

Installation

First, set up and run this Rails project somewhere. It does not need a database or anything else special.

Then, include the tag to load the javascript and give it a link to click (you can style this link to your liking):

<script id="zdWidgetScript" type="text/javascript" src="http://myzdwidgetapp.herokuapp.com/widget.js"></script>
<div id="zdOpenWidget"><img src="/images/support.png"></div>

There is some required CSS so the widget modal can be shown. This is formatted as SCSS:

#zdWidgetOverlay {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  outline: 0;
  z-index: 1060;
  overflow-x: hidden;
  overflow-y: auto;
  @include transition(opacity, 0.3s);

  &.in {
    display: block;
    opacity: 1;
  }
}

#zdWidgetContainer {
  position: relative;
  width: 600px;
  height: 400px;
  margin: 0 auto;
  padding: 15px;
  background-color: white;
  box-shadow: 0 5px 15px rgba(0,0,0,0.25);
  border-radius: 5px;

  iframe {
    width: 100%;
    height: 100%;
    border: 0;
  }
}

Then you can call this JS to initialize the widget:

if (typeof window.zdWidget !== "undefined") {
  zdWidget.init({
    name:     "<%= current_user.name %>",
    email:    "<%= current_user.email %>",
    category: 1234567890,
    fields:   {
      1234567890: "some value"
    }
    chat: true,
    chat_tags: 'Admin,SalesLoft',
    chat_department: 'Support'
  });

These are the fields taken in:

  • name - The requester's name.
  • email - The requester's email address.
  • category - (optional) The ID of the help center category to limit your searches to.
  • fields - (optional) A object of custom fields to set on the ticket. The key is the ID of the field, and the value is the value.
  • chat - (Defaults to false) Flag turning on Zopim Live Chat.
  • chat_tags - (optional) String of comma seperated tags to add to current chat session.
  • chat_department - (optional) Default department to direct the visitors current session.

deskjockey's People

Contributors

barberj avatar sionide21 avatar timdorr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

barberj

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.