1

Summary

Is it possible to use the Gmail forwarding feature to send (i.e., “push”) via HTTP (GET/POST) to my GAS script URL? (And perhaps include its contents as a parameter?)

Goal/Background

My goal is to immediately process my incoming Gmail instead of, say, using the GAS trigger feature to query and “pull” my Gmail on a periodic basis.

The former method is relatively immediate. Whereas, the latter method creates an expected delay equal to the mean interval time between (automatically triggered) queries to my inbox.

Possible Solutions

1. Gmail Data API

This documentation states Gmail lacks a data API.

2. Atom/RSS Feeds

Atom/RSS feeds still require an aggregator to pull the data from the server and, thus, do not accomplish my goal of a push-only solution to my GAS URL to, then, in turn, trigger my script via doGet() or doPost().

3. IMAP/POP

These solutions are designed for desktop/offline processing of emails and, therefore, do not meet my goals. I need a solution that lives on the web and automates my web-based email checking tasks.

4. High-frequency GAS Trigger

A, say, 60-second trigger interval in GAS does not work because there is a cost to such high-frequency triggers in GAS due to quota limitations. i.e., I don't want to use up that much quota space on this one task because I need it for other stuff.

5. 3rd Party Listeners

I would prefer something free if possible. Someone has suggested Zapier® — which does have a free version. Do these work? Are there others?

Conclusion

Are there any creative ideas out there? Perhaps to point me in a creative direction?

I would even settle for just a way to be immediately notified (programmatically) that I received a new email.

4

2 回答 2

2

Google Apps 脚本无法实现:Google Apps 脚本当前可用的事件: https ://developers.google.com/apps-script/understanding_events

Gmail 有数据 API 吗?常见问题解答:https ://developers.google.com/gdata/faq#GmailAtomFeed

看起来 IMAP 是唯一的选择,不确定 IMAP 是否支持回调。

于 2013-06-17T08:34:13.310 回答
1

触发器可以每 60 秒启动一次脚本。正如您之前所说,这会使您的平均通知时间为 30 秒(让我们不要开始讨论统计假设中可能存在的缺陷)。

更直接的行动的另一种可能性是使用像 Zapier.com 这样的服务作为监听器。它可以在您的 gmail 收件箱中侦听新电子邮件,应用过滤器,并向您的 Apps 脚本的 URL 发起 GET/POST(确保它是已发布的最新版本)。

我希望这有帮助。好奇为什么你需要立即处理这些消息......

于 2013-06-17T14:32:45.943 回答