Skip to content

Instantly share code, notes, and snippets.

{
"eventType": "orderPlaced",
"customer": {
"firstName": "String",
"lastName": "String",
"emailAddress": "String",
"phoneNumber": "String",
"customerType": "String or Array of strings",
"customerId": "String or Number",
"profileLinkUrl": "String"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>{{lastMessage.subject}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body style="margin: 0; padding: 0;">
{
"eventType": "orderPlaced",
"customer": {
"firstName": "String",
"lastName": "String",
"emailAddress": "String",
"phoneNumber": "String",
"customerType": "String or Array of strings",
"customerId": "String or Number",
"profileLinkUrl": "String"
{
"id": "a786a291429bc7eeff7fef79",
"type": "transaction",
"attributes": {
"data": {
"@context": "http://schema.org",
"@type": "ParcelDelivery",
"deliveryAddress": {
"@type": "PostalAddress",
"streetAddress": "226 W. Rittenhouse Square\n#3016",
@danjstern
danjstern / Gemfile
Created March 10, 2014 22:08
Export Desk.com knowledge base articles to Salesforce Knowledge zip format. Support images and multiple languages
source 'https://rubygems.org'
ruby '2.0.0'
gem 'desk_api', '0.5.0'
gem 'rubyzip', '1.1.0'
gem 'open_uri_redirections', '0.1.4'
{% assign emails = case.emails %}
{% assign threadlength = emails.size|minus:1 %}
{% for email in emails reversed %}
{% if forloop.first %}
{{email.new_html}}
{% if email.agent %}
{% if email.agent.signature %}
@danjstern
danjstern / upsert_customer.rb
Created August 12, 2013 17:17
Sample script to upsert customer records from a CSV
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
OAUTH_TOKEN = ''
OAUTH_TOKEN_SECERT = ''
##Site name is just the desk.com subdomain and does not include desk.com
SITE_NAME = 'sitename'
CSV_PATH = './customers.csv'
ARRAY_SEPERATOR = ';'
@danjstern
danjstern / Script
Created July 26, 2013 17:22
Desk.com Customer Ruby Example
#Fill in the following credentials
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
OAUTH_TOKEN = ''
OAUTH_TOKEN_SECERT = ''
#SITE_NAME is just the first part of your site url.
#For Example if your desk address is https://demoscript.desk.com, the SITE_NAME is demoscript
SITE_NAME = ''
<div class="agent_customer_merge_box">
<div class="a-form-label">
<a href="#" style="text-decoration:underline;">Merge Customer</a>
</div>
<div>
Merge duplicate customers to keep cases organized.
</div>
</div>
@danjstern
danjstern / gist:5570101
Created May 13, 2013 17:50
Skip Pre-create
REPLACE
{{form_begin}}
WITH
{%capture begin_email_form%}
{{form_begin}}
{%endcapture%}
{{begin_email_form|replace:'/customer/portal/emails/pre_create','/customer/portal/emails'}}