Can I run an Google Apps Script when a Gmail filter matched?
In other words, I'd have a Google Apps Script somewhere and it is always ran when an incoming email matches the filter criteria.
Why? Currently I have a web application querying a Gmail account every minute. This seems wasteful. Because the email the application expects arrives rarely, about once a day. But I would like a quick reaction on that email.
The Apps Script would query an API URL of the web application and the web application would then request the email.
Something like a callback. Don't poll but wait till a callback arrives.