Skip to content

Instantly share code, notes, and snippets.

@Furzel
Furzel / front-test-plugin.js
Created February 12, 2015 09:43
Front test plugin
var conversation;
function unassign() {
Front.unassign(conversation);
}
function toggleArchive() {
Front.toggleArchive(conversation);
}
@Furzel
Furzel / gist:747b69236ad2923a27a7
Created February 3, 2015 21:00
intercom update on new message
function updateMessageActivity(message, date, done) {
message.company.listTeam(function (err, teammates) {
if (err)
return done(err);
var user = (message.author) ? message.author : teammates[0],
now = Math.floor(date/1000);
var intercomData = {
email: user.email,
@Furzel
Furzel / basic_conversation.json
Last active August 29, 2015 14:14
Conversation JSON
{
"id": 42,
"url": "/api/1/companies/mycompany/conversations/42",
"type": "conversation",
"message_type": "email",
"status": "unassigned",
"archived": false,
"trashed": false,
"replied": false,
"reacted": false,
@Furzel
Furzel / build_nw.bat
Created October 16, 2014 13:45
Auto build nw application on nw with custom icon
@echo off
REM %1 is either staging or prod
REM Copy the config files and resources
copy %1\package.json .
copy %1\config.json .
copy ..\res\img\favicon.png .
copy ..\res\img\logo.png .
@Furzel
Furzel / post_email_public_api.js
Created September 30, 2014 12:54
Post an email to Front public API
var https = require('https'),
url = require('url');
// your credentials
var apiKey = '*** YOUR API KEY ***',
companySlug = '*** YOUR COMPANY SLUG ***';
// Build the first request to retrieve all your inboxes
var listInboxesOptions = {
host: 'webhooks.frontapp.com',
@Furzel
Furzel / public_sms_format.json
Created September 30, 2014 11:13
Front sms format for public api
{
"from": "+123456789",
"body": "Your sms content"
}
@Furzel
Furzel / email_post_format.json
Created September 30, 2014 10:32
Send Email to Front's public API
{
"from": "sender@provider.com",
"subject": "Email's subject",
"text_body": "Your email content in a text format",
"html_body": "Your email <b>content</b> in an <i>HTML</i> format"
}
@Furzel
Furzel / list_inboxes_response.json
Last active August 29, 2015 14:07
list inboxes response format
[
{
"alias": "support",
"name": "Support",
"type": "imap",
"address": "support@mycompany.com",
"links": {
"messages": "webhooks.frontapp.com/api/1/inboxes/support/messages",
"inbox": "webhooks.frontapp.com/api/1/inboxes/support"
}
@Furzel
Furzel / api_contact_json.json
Created September 25, 2014 01:41
Contact route expected JSON
{
"name": "String - your contact full name",
"description": "Optional String - describe your contact",
"fields": [
{
"source": "String - either email, twitter or phone",
"handle": "String - email address, phone number, twitter handle as selected by the above source field"
}
],
"links": [
@Furzel
Furzel / front_contact_api.js
Created September 25, 2014 01:26
Basic Front contact API example
var https = require('https');
var apiKey = '*** YOUR API KEY ***',
companySlug = '*** YOUR COMPANY SLUG ***';
var data = {
name: 'Arthur Dent',
description: 'Earthman',
fields: [
{