Search code examples
google-apps-scriptgoogle-chrome-extensiongmail-addons

How to access Gmail messages selected (checkbox)


I am trying to build an Add-On for gmail which will perform some actions on a set of messages selected by the user. Looking at the gmail Apps Script API, I cannot see a method that allows me to do that.

I've noticed that some AddOns operate on selected messages, just like what I want to do. See picture below... The checkboxes (highlighted in green) tell the AddOn what to operate on.

What am I missing?

The opened menu has options to forward the messages selected by combining them.

Also, I noticed that this AddOn is placed by google along the top. The same happen to the boomerange AddOn. The AddOn I am developing, always appears on the right hand side (pink arrows). How can you place your addOn along the top menu?

enter image description here


Solution

  • The items you reference with the orange arrows in the image are not Gmail Add-ons, they are actually Chrome Extensions. Chrome Extensions are installed in the browser and they can add functionality by manipulating the DOM (Document Object Model) of a webpage. The chrome extension in question is probably specifically targeting chrome tabs with Gmail loaded and injecting content in the respective pages.

    If you want to learn more about developing Chrome Extensions check out the following documentation:

    https://developer.chrome.com/extensions/devguide

    And for developing gmail specific Chrome Extensions you might want to check out the InboxSDK framework linked below:

    https://www.inboxsdk.com/