CiviGmail - Integration With Gmail

Published
2016-10-06 14:19
Written by

CiviGmail is a chrome extension for Gmail, which allows Gmail to directly interact with CiviCRM via OAuth2. Once authorized emails can be filed as activities in CiviCRM. Idea is to support same set of features like CiviOutlook, reusing its apis.

Features

  1. Record emails from Gmail inbox against CiviCRM contacts
  2. Use email address deduplication to attach emails to the correct contact including creation of a new contact if they don't exist.
  3. Prompts for duplicate contacts so that user can select which ones they want to create the activity with.
  4. Supports multiple attachments

Prerequisites

  1. Setup OAuth2 Server on your civi site - https://www.drupal.org/project/oauth2_server.
  2. Download and install civicrm extensions - gmailapi and outlookapi on civi site, where you want activities to be created -

Setting Up OAuth2 on Civi Site (Drupal)

  1. Download and install drupal module - https://www.drupal.org/project/oauth2_server.
  2. Enable the OAuth2 server module.
  3. Create a server. Go to admin/structure/oauth2-servers and create a server. Leave the default values in settings, they will be explained later.
  4. Create a scope. Click the "scopes" link, and you will be taken to the scopes listing page. Make sure you have at least one scope with label as “civigmail_extension”. Description could be anything say “CiviGmail Scope”.

  5. A client is an application requesting authorization from the resource owner (logged-in user on your website). In our its going to be CiviGmail user.
    • Client ID. This could be set to chrome extension ID “egjglhooblpbneakhiphjdicboojpamj”.
    • Client Secret. Set this to some key that you going to share with CiviGmail users. The Client ID and Client Secret can be thought of as the client username and password. The client id is considered public information while the client secret must be kept private at all cost.
    • Redirect URI. Set this to “https://egjglhooblpbneakhiphjdicboojpamj.chromiumapp.org/
  6. Give permission for using the OAuth2 Server. In admin/people/permissions, in section OAuth2 Server, check the permission Use OAuth2 Server (Use OAuth2 Server for authorization.) for anonymous users.
  7. You are now ready to handle authorization requests.

Setting Up CiviGmail for Chrome

  1. From your chrome browser visit - https://chrome.google.com/webstore/detail/civigmail/egjglhooblpbneakhiphjdicboojpamj?hl=en-GB&gl=GB&authuser=1 and click “ADD TO CHROME”.
  2. Agree to permission prompt and click “Add Extension”.
  3. Visit extensions page in your chrome browser - chrome://extensions/.
  4. Locate CiviGmail and click options. Specify url options and save:
  5. CiviCRM URL e.g https://example.org/civicrm
  6. Go to your gmail. Make sure to reload your gmail by visiting - https://mail.google.com (without any # params).
  7. On load you will see two buttons “Connect Civi” and “Record Activity”.

  8. Initiate OAuth by clicking “Connect Civi” button. This will trigger a new pop-up where you will need to enter site username and password, followed by “Yes, I want to authorize this request” button.
  9. Once authorized, click select any email from inbox, and click “Record Activity” to file it in Civi.

Known Issues

  • Its an initital release that only works with Inbox for now.
  • Limited to Drupal at this point due to OAuth2. We exploring other CMS.
Filed under

Comments

Anonymous (not verified)
2016-10-07 - 07:20

Where are the instructions for setting this up on WordPress?

Anonymous (not verified)
2016-10-17 - 07:53

It's a very interesting and intelligent extension :) Are you planning also to make it compatible with Joomla?

Anonymous (not verified)
2016-12-11 - 19:54

I installed and followed the instructions but it doesn't work. I posted an issue on the github repo with details.

 

When I clicked on Connect Civi button in gmail it loaded the user login page. I entered my user login and then it gave me the following error:

Fatal error: Class 'OAuth2\Request' not found in /home/web-user/www/www/sites/all/modules/oauth2_server/oauth2_server.pages.inc on line 31

I refreshed gmail page and tried Connect Civi again and it immediately goes to the error.

This is so interesting! It's wonderful especially for organizations using G-Suite in Google For Nonprofits! How far are you with the WordPress implementation?