I am currently very interested in Gmail Add-on development. My problem is that I want to build an add-on which can read multiple emails and makes it possible to create filters and labels. The Add-on should always be visible, not only after opening an e-mail. Is that possible? If yes: what actions should I define in the manifest file?
1 Answers
To quote documentation (emphasis mine):
Gmail add-ons that you have installed automatically appear in the Gmail user interface when you open a message.
To elaborate: the only current trigger - what is used to tell add-ons to display - that exists is the unconditional
contextual trigger. Here again, documentation states the operational context as
... When the user opens a Gmail message that meets the trigger criteria, the trigger fires. A fired trigger executes an Apps Script trigger function that constructs the add-on user interface and returns it for Gmail to display. At that point the user can begin interacting with it.
This does not mean you cannot use your email to manipulate labels of both the selected message and others. It merely means that you will need the user to grant you a very broad scope (since you want to access all of the user's inbox and not just the message for which the user opened your add-on), and that you cannot make your add-on be always visible. Only when the user opens an email can they use your add-on to link it to existing labels, etc.

- 9,645
- 4
- 24
- 42