3 ms·
More interesting than GmailApp, DriveApp, etc. are the Gmail, Drive etc. classes. They're under the "advanced" services, and far more powerful (and faster). Hig
by dataflow 5y ago
More interesting than GmailApp, DriveApp, etc. are the Gmail, Drive etc. classes. They're under the "advanced" services, and far more powerful (and faster). Highly recommend them for more serious uses of Google Apps Script.
- mattst88 5y agoInteresting, thanks. I'll check that out.
- dataflow 5y agoYup, np. More tips: - For more real-time filtering you might also want to look into integrating with Google's Pub/Sub service (see Gmail.newWatchRequest() and Gmail.Users.watch()). It's kind of a pain to set up but it can help you avoid having to wait 10 minutes for everything to run, though you'll still want to have a polling mechanism as a fallback, and you might need to periodically call the watch methods to ensure you keep getting notifications pushed to you. - If you need even better performance you can try manually batching up the HTTP requests via googleapis.com/batch (you can use ScriptApp.getOAuthToken() to get the auth token). This will let you factor out some of the server overhead across messages.