1

I'd like to trigger a script every time I view an email in gmail. Does anyone know if there a trigger for detecting this which i can bind to?

I'm open to doing this with any platform, not just google-apps-script.

  • 1
    I don't know if it's possible with the external API, but you might want to look at the documentation to set up a "watch" and a push notification. [Push Notifications](https://developers.google.com/gmail/api/guides/push) and [Link to Watch](https://developers.google.com/gmail/api/v1/reference/users/watch) – Alan Wells Dec 12 '16 at 04:18
  • @SandyGood: Great idea! – Rubén Dec 12 '16 at 14:31

1 Answers1

3

Short answer

At this time Google Apps Script doesn't have a triggers for Gmail events.

Explanation

On Google Apps Script there are three kinds of scripts, bounded, stand-alone and web apps, and two kinds of triggers, simple and installable

Scripts only could be bounded to documents, forms and spreadsheets.

The available simple triggers are:

  • onOpen(e)1,2,3
  • onEdit(e)2
  • onInstall(e)4
  • doGet(e)5
  • doPost(e)5

The available installable triggers are:

  • Time-driven triggers
  • Google Apps triggers
    • on open1,2,3
    • on edit2
    • on change2
    • on submit form2,3

Triggers by app

The triggers works on the following "environments":

  1. Google Documents editor
  2. Google Sheets editor
  3. Google Forms editor
  4. Add-ons
  5. Web Apps

Note: There are no simple nor installable that works on the Google Forms Viewer (response submission).

References

Rubén
  • 34,714
  • 9
  • 70
  • 166