Thursday, October 6, 2016 - 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.


  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


  1. Setup OAuth2 Server on your civi site -
  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 -
  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 “
  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 - 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
  6. Go to your gmail. Make sure to reload your gmail by visiting - (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


Where are the instructions for setting this up on WordPress?

We looking into supporting wordpress. Its not done yet.


I'll second the request for WordPress as an alternate CRM.  Thanks for considering it briefly, then making it happen.


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

Thanks. No plans for joomla yet. If you would like to fund / discuss joomla, contact us at support at

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/ 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?