Skip to content
Write faster using templates and keyboard shortcuts.
Branch: master
Clone or download
ghinda Facebook Messenger support (#303)
* Fix handling template insert in Draft.js editor.
* Add support for messenger.com.
* Fix `to` and `from` contacts in Facebook/Messenger.
Latest commit 9cad425 Mar 25, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
artwork Changed baseURL to chrome.gorgias.io in preparation for swithcing our… Sep 25, 2018
config webpack integration (#272) Apr 4, 2018
src Facebook Messenger support (#303) Mar 25, 2019
tests webpack integration (#272) Apr 4, 2018
.editorconfig
.gitignore
.jshintrc
.kateconfig Create shared config for the tests. Nov 7, 2014
.travis.yml Install global bower. Nov 16, 2014
Gruntfile.js
LICENSE
README.md webpack integration (#272) Apr 4, 2018
ext.zip
package.json Facebook Messenger support (#303) Mar 25, 2019
translation.py Added automated translation Feb 10, 2015
webpack.config.js Use fixed baseURL and apiBaseURL (#297) Mar 1, 2019
yarn.lock Firestore usage experiment (#290) Feb 8, 2019

README.md

Gorgias Chrome Extension

Google Chrome plugin for improved productivity on the web.

Sites supported

  • Gmail
  • Outlook.com
  • Yahoo Mail
  • Linkedin

Developing extension

Development is done using Grunt. So first you need to install Yarn and Grunt (Grunt is being used for only test in current version). Then, run yarn install to install all dependencies.

There are available following commands:

  • yarn start - Development mode. Creates development manifest, watches for styl files and recompiles them automatically.
  • yarn build - Build extension and compress extension.
  • grunt test or grunt t - Run tests.

Known issues

  1. Saving a template from the context menus doesn't work with multi-lines.

    Relevant bug: https://code.google.com/p/chromium/issues/detail?id=116429

    This means that when selecting a text to save as a template it will not preserve newlines.

Creating templates

Templates are powered by handlebars.js.

Following template variables are available:

  • subject string
  • from list; Each list element contains:
    • name string
    • firt_name string
    • last_name string
    • email string
  • to list similar to from
  • cc list similar to from
  • bcc list similar to from

To output a string use following syntax:

String variables are denoted by double curly braces: {{subject}}

If subject is My email subject then it be rendered to:

String variables are denoted by double curly braces: My email subject

To output a list use following syntax:

To:
{{#each to}}
- Name {{name}}
- First name {{first_name}}
- Last name {{last_name}}
- Email {{email}}
{{/each}}

You also may want to output list only if it has values:

{{#if to}}
To:
{{#each to}}
- Name {{name}}
- First name {{first_name}}
- Last name {{last_name}}
- Email {{email}}
{{/each}}
{{/if}}

If you want to output only second element from list (note that list numbering starts with 0):

{{#if to.[1]}}
Second To:
- Name {{to.1.name}}
- First name {{to.1.first_name}}
- Last name {{to.1.last_name}}
- Email {{to.1.email}}
{{/if}}

Building plugins

You can build plugins using the App.plugin('PLUGIN_NAME', {}) method.

Check out the src/content/plugins/*.js files for examples on how a plugin show look.

Each plugin must expose the following methods:

  • init
  • getData

All plugin methods should take two arguments: params and callback.

The params argument is an object which can contain other objects or properties that you can use in the method.

The callback argument should be a function called at the end of the method, after all async functionality.

The callback function uses Node.js-style arguments. The first one is an error object returned in case of errors, otherwise return null. The second argument is the actual method response.

Plugin methods

init

The init method should respond with a boolean value, false by default, and true if the plugin should be activated.

getData

The getData method receives the following params object:

params: {
    element: DOM_ELEMENT
}

The params.element object is a reference to the DOM element on which the autocomplete was triggered. It can be a contenteditable element, or a form element.

The response of the getData method should look like:

{
    from: [],
    to: [],
    cc: [],
    bcc: [],
    subject: ''
}

Each array should contain objects that look like:

{
    name: '',
    first_name: '',
    last_name: '',
    email: ''
}

setTitle

// TODO

Testing

Before running the tests, run:

yarn install

Then key your Chrome private .pem keyfile and copy it as key.pem in the repository root.

Set the QUICKTEXT_GMAIL_USERNAME and QUICKTEXT_GMAIL_PASSWORD ENV variables, for logging-in into Gmail.

export QUICKTEXT_GMAIL_USERNAME=abc
export QUICKTEXT_GMAIL_PASSWORD=def

Then, to run all the tests:

grunt test

or only for the contentscript:

grunt test:content

or only for the background script:

grunt test:background

Running the tests will recompile the app for production and test that.

If you want to run the tests locally (not on Sauce Labs) without recompiling the app, run:

grunt protractor:background

or

grunt protractor:content
You can’t perform that action at this time.