-2

I'm trying to create a Gmail web add-in using apps-script in which I am trying to do the following things:

  1. make an API call on receiving an email.
  2. label emails.
  3. move emails to
  4. spam. get all emails of a specific folder.

Is this possible? If Yes then how? Please give me the links to any documentation or tutorials for the same.

ashwani gupta
  • 140
  • 1
  • 8
  • 1
    Hi and welcome to Stack Overflow, please take a time to go through the [welcome tour](https://stackoverflow.com/tour) to know your way around here (and also to earn your first badge), read how to create a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) and also check [How to Ask Good Questions](https://stackoverflow.com/help/how-to-ask) so you increase your chances to get feedback and useful answers. – Jessica Rodriguez May 30 '19 at 13:50

1 Answers1

0

It is sort of possible, but you should be aware that Gmail Add-ons can be triggered either by opening an email or opening compose Ui both by explicit user interaction with Gmail, not when an email is recieved (though, Gmail Add-ons platform is growing and this trigger can be added in the near future).

As for the actions 2-4, they are entirely possible, you should take a look at the following references:

  1. Gmail Add-ons guide and reference;
  2. GitHub repo with sample Add-ons from Google;
  3. OAuth2.0 library for 3P service calls (if it authenticates via OAuth2.0);
  4. Gmail service reference for apps script.

This should definitely help you get started, happy coding!