Skip to content

Instantly share code, notes, and snippets.

View tstachl's full-sized avatar

Thomas Stachl tstachl

  • Pilina
  • Remote
View GitHub Profile
module ZendeskAPI::Middleware::Request::RetryExtension
def call(env)
super
rescue Errno::ETIMEDOUT, Timout::Error, Net::HTTPBadGateway => err
retry
end
end
class ZendeskAPI::Middleware::Request::Retry
prepend ZendeskAPI::Middleware::Request::RetryExtension
<div id="case_salesforce_section">
{{widget.salesforce.body}}
</div>
@tstachl
tstachl / desk_multipass.php
Last active April 23, 2017 03:16
WordPress - Desk.com Multipass SSO Plugin
<?php
/**
* Plugin Name: Desk.com Multipass
* Plugin URI: https://github.com/tstachl/wp-desk_multipass
* Description: A WordPress plugin to add a menu option that redirects to your Desk.com Support Site.
* Version: 1.0.0
* Author: Thomas Stachl
* Author URI: https://github.com/tstachl
* License: BSD 3-Clause License
*/
<!-- different web themes -->
<div id="company-support-portal">
<div id="company-header">
<div class="wrapper">
{{ desk.page.theme.header_content }}
<div id="customer-account">
{% if current_user and current_user.is_guest == false %}
<span>
{{system.snippets.welcome}} {{ current_user.customer.name }}
@tstachl
tstachl / DeskApiExample.cs
Created January 24, 2015 21:39
This is an example of how you can interact with the Desk.com API using C#. It shows the 4 basic requests "GET", "POST", "PATCH" and "DELETE". If you have any questions reach out to us at support@desk.com.
using System;
using System.Text;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using Newtonsoft.Json.Linq;
namespace DeskApiExample
{
class MainClass
<h2>{{email.subject}}</h2>
{% if email.subject contains 'Suggestion' %}
<h3>This is a suggestion</h3>
{% else %}
<h3>This is default</h3>
{% endif %}
{% if case.group.name == 'Support' %}
<!-- put the case theme for support here -->
{% elsif case.group.name == 'Internal' %}
<!-- put the case theme for internal here -->
{% else %}
<!-- put the case theme for default here -->
{% endif %}
{
"type": "email",
"subject": "Email Case Subject",
"priority": 4,
"status": "open",
"labels": [
"Spam",
"Ignore"
],
"message": {
<div class='input-block'>
<span class='label'>
CUSTOM FIELD LABEL <span>({{system.snippets.required}})</span>
</span>
<div>
{{ ticket_custom_**CUSTOM FIELD KEY** }}
</div>
</div>
<?php
$date = new DateTime('2015-01-21T20:34:53Z');
$date->setTimezone(new DateTimeZone('Pacific/Chatham'));
echo $date->format(DateTime::ISO8601);