Skip to content

Instantly share code, notes, and snippets.

View DeskWOW's full-sized avatar

Desk.com Customer WOW Team DeskWOW

View GitHub Profile
@DeskWOW
DeskWOW / gist:8717015
Created January 30, 2014 19:35
Ruby code example of multipass endpoint
post '/login' do
user = params[:user]
password = params[:password]
if user == "ty" && password == "password"
SITE_KEY = "zzz-ty-multipass"
API_KEY = "4a5b3be36eac5363893a43035e02d048" # Example dummy key
multipass_string = MultiPass.encode(
SITE_KEY,
@DeskWOW
DeskWOW / gist:8828669
Last active August 29, 2015 13:56
You can use this technique to give the impression of "categories of topics". For every category, you'll do a for loop of all topics and render the ones that have the proper category code in their topic description (as defined by you).
<h2>Support Center Categories</h2>
<h3>Quick Start Guide</h3>
{% for topic in topics %}
<ul>
{% if topic.desc contains "[QSG]" %}
<li><a href="{{ topic.public_url }}">{{ topic.name }}</a> (#{{ topic.id }})</li>
{% endif %}
</ul>
@DeskWOW
DeskWOW / 1) Chat Widget - New Chat Screen.html
Last active August 29, 2015 13:59
Persisting Chat — The following is a custom Desk.com chat widget that supports persisting chat session as user navigates pages. [Demo: https://zzz-ty.desk.com/?t=444102]
<!-- At the top of this theme, place the following code: -->
<script>document.cookie="chat_id=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/";</script>
@DeskWOW
DeskWOW / gist:11355769
Created April 27, 2014 21:08
JavaScript to redirect back to the support center home page. Can be pasted into any page, such as the Email (Submitted) page.
<script>window.location = '{{ desk.system.links.home }}';</script>
@DeskWOW
DeskWOW / 1-Header.html
Last active November 15, 2016 18:11
Chat widget article suggest. Be sure to replace "YOUR-SITE.desk.com" with your Desk.com URL.
<title>{{ site.company_name }}</title>
<link rel="icon" type="image/vnd.microsoft.icon" href='{{ "/favicon.png" | portal_image_url: image_asset_host }}' />
<link rel="icon" type="image/png" href='{{ "/favicon.png" | portal_image_url: image_asset_host }}' />
<style type="text/css">
.customer_inner_widget
@DeskWOW
DeskWOW / *.txt
Last active December 23, 2015 15:19
Dec 23, 2016 Update: Desk has just released a new feature - Dependent Dropdowns - that is easy to set up and manage within the Desk Admin UI. Read more here: https://support.desk.com/customer/en/portal/articles/2166248
A simple dependent dropdown in Desk.com support center contact form.
Demo: https://zzz-ty.desk.com/customer/portal/emails/new?t=451478
@DeskWOW
DeskWOW / 1 - Header.html
Last active August 29, 2015 14:01
This Desk.com custom email widget theme adds an example custom field and article suggest functionality. To input this code into your widget, login to your Desk.com Admin panel and go to Channels -> Email -> Widgets. Be sure to update the "ajax" part of the JavaScript code to point to your Desk.com subdomain (instead of YOUR-SITE).
<title>{{ site.company_name }}</title>
<link rel="icon" type="image/vnd.microsoft.icon" href='{{ "/favicon.png" | portal_image_url: image_asset_host }}' />
<link rel="icon" type="image/png" href='{{ "/favicon.png" | portal_image_url: image_asset_host }}' />
<style type="text/css">
.customer_inner_widget
@DeskWOW
DeskWOW / gist:033d082b0cc5cf90cf8f
Created June 16, 2014 14:51
Reveal chat link only if one or more agent is online and ready to chat. We determine how many agents are available to chat by counting how many agents have routing enabled.
$(function() {
$.ajax({
url: 'http://your-site.desk.com/customer/agent_online_check',
dataType: 'jsonp'
}).done(function(data) {
if (data.routing_agents > 0) {
$(".chat-link").show();
}
});
});
@DeskWOW
DeskWOW / 1-Old.html
Last active August 29, 2015 14:03
When rendering forms for logged-in private portal users, instead of hiding name and email, display it but pre-fill it.
{% if current_user == nil or current_user.is_guest %}
<div class="input"><span class="form_label">{{system.snippets.your_name}}:</span>
{{ interaction_name }}
</div>
<div class="input">
<span class="form_label">{{system.snippets.your_email}}: <span class="form_label_required">({{system.snippets.optional}})</span></span>
@DeskWOW
DeskWOW / 1-Header.html
Created July 3, 2014 21:11
"New Email Form" (Email Widget theme)
<title>{{ site.company_name }}</title>
<link rel="icon" type="image/vnd.microsoft.icon" href='{{ "/favicon.png" | portal_image_url: image_asset_host }}' />
<link rel="icon" type="image/png" href='{{ "/favicon.png" | portal_image_url: image_asset_host }}' />
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<style type="text/css">
.hide {
display: none !important;