Pragmatic – Leading provider of open source business applications OpenERP, Ruby on Rails, Node.js, Talend, jaspersoft  – Pragmatic
Beyonce Adams

Odoo OpenERP CRM Google Apps / Gmail Integration Contextual Gadget


Pragmatic has created the much required automation and seamless integration of Odoo with Gmail Plugin/ extension. We had used the Gmail Contextual Gadget to integrate with Odoo and create Leads/ Contacts/ Customers/ Support Tickets and much more at just a click of a button.

Pragmatic Odoo Gmail Gadget – Preview

Gmail Contextual Gadget (Gmail plug-in/extension): Contextual gadgets are applications that are displayed at the bottom of individual email messages and are triggered by contextual clues, such as the contents of Subject lines, sender and recipient email addresses, and more.


Gadgets are custom HTML and JavaScript components that run within an iframe and can be embedded within various web pages. Gmail includes support for embedding gadgets within the web interface, creating content-rich data displays and extending Gmail with additional functionality.

Contextual Gadgets

Contextual gadgets are applications that are displayed at the bottom of individual email messages and are triggered by contextual clues, such as the contents of Subject lines, sender and recipient email addresses, and more. For example, Gmail already provides a YouTube contextual gadget. If the body of an email contains a link to a YouTube video, a clickable thumbnail view of the video appears at the bottom of the email.

Contextual gadgets support the gadgets.* API as well as an additional API that allows them to extract contextual clues. Contextual gadgets in Gmail provide a way to integrate functionality into the workflow at precisely the point where it is useful.

A Gmail contextual gadget is a gadget that is triggered by clues in Gmail, such as the contents of Subject lines and email messages.

Development and deployment of Contextual Gadgets

There are two development and deployment models:

  • Develop a Gmail contextual gadget for use within a single organization’s Google Apps domains (an in-house application).
  • List the gadget for sale on the Google Apps Marketplace.

A Gmail contextual gadget can be triggered by content in any of the following parts of an email:

  • From
  • To
  • CC
  • Subject
  • Body
  • Sent/received timestamps

Gadget Structure

The implementation of a Gmail contextual gadget consists of two parts:

  • 1.Extractors – Can be one or more extractors
  • 2.The Gadget Spec


Detects contextual clues in email, determines which types of content will trigger the gadget, and passes the triggering content to the gadget. An extractor does this by comparing a given regular expression to content in one or more given parts of each individual email message (From:, To:, etc.). In the YouTube gadget, the extractor checks the subject line and body of the email for strings that match the pattern of a YouTube URL.

Gadget spec

Takes action based on the content passed in from an extractor. The gadget spec includes client-side logic and UI. In the YouTube gadget, the gadget spec accepts the YouTube URL and draws a thumbnail view of the video at the bottom of the email, which you can click to play the video–right inside Gmail.

Create Contextual Gadget for Odoo

Summary of steps

  • 1.Use JQuery, or write JavaScript that conforms to ECMAScript 5 Strict Mode.
  • 2.Choose one or more pre-canned extractors. This determines which type of content will trigger your gadget.
  • 3.Write a manifest for the gadget.
  • 4.Write the gadget spec. This determines what the gadget will do when it is triggered.
  • 5.Publish the gadget spec to a location which is accessible on the public Internet. An intranet will not work. Your hard drive will not work. (Why? Google’s servers need to download the gadget. If they can’t reach it, then Gmail can’t display it.)
  • 6.Install the gadget.
  • 7.Test the gadget by sending yourself some email. The gadget should appear in Gmail whenever you read an email that contains the right sort of content

Google Apps Marketplace contains enterprise applications that can be added to a Google Apps domain. If you are an application developer, you can publish enterprise apps to the marketplace for others to use. If you’re an enterprise admin for Google Apps, you can discover and install new apps from the marketplace.
To publish “Google marketplace app” we have to create Google app account and also have to register domain.
Goto and login with gmail business domain administrator account.

Create client id for web application from credential tab, set authorized javascript url

Select configuration from Google apps marketplace sdk and give required information, like, App icon, app name, description etc.
Select gmail contextual gadget extensions, Click ok and then click on Test Installation

It will ask for conform installation accept it and your app is now installed to your gmail domain
Now login with your business account domain administrator and select the gadget from Marketplace Apps.

Gmail Odoo integration screens

Click on Go button. It will check this will search for lead and if email id is found in lead will show lead info.

Lead information form
If that email id is not present in odoo lead then it will open create lead form.
Create lead page

Fill these information and click on submit will create lead in odoo.


Leave a Reply

Subscribe to Blog via Email.

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Recent Comments

Related Posts