【问题标题】:firebase function triggered on email received收到电子邮件时触发的firebase功能
【发布时间】:2020-11-15 20:11:45
【问题描述】:

当在 Gmail 或 Outlook 上收到电子邮件时,有没有办法触发 firebase 功能或在 Firestore 中创建项目。

我正在尝试重新创建 ServiceNow 的功能,如果帮助台电子邮件地址收到了一封电子邮件,它将自动从中创建一个票证(到 firestore)。

谢谢!

【问题讨论】:

    标签: firebase google-cloud-firestore google-cloud-functions


    【解决方案1】:

    这是 Gmail 的一种可能解决方案(未经测试):

    根据Gmail API documentation

    Gmail API 提供服务器推送通知,让您观看 对于 Gmail 邮箱的更改... 每当邮箱更改时,Gmail API 通知您的后端服务器应用程序。

    ...

    Gmail API 使用Cloud Pub/Sub API 传递推送通知。

    由于您可以触发 Cloud Function whenever a new Pub/Sub message is sent to a specific topic,您可以执行以下操作:

    1. Set up a Cloud Pub/Sub client
    2. 使用您的 Cloud Pub/Sub 客户端 create the topic Gmail API 应向其发送通知。
    3. 将 Gmail 帐户配置为 send notifications for mailbox updates
    4. Write a Cloud Function 每当有新的 Pub/Sub 消息发送到该主题并执行所需的业务逻辑(例如写入 Firestore)时触发

    对于 Outlook,SO answer 表示在收到新邮件时应该可以调用 API。您可以拨打HTTPS Cloud Function 或直接拨打Firestore REST API

    【讨论】:

    • 那么用outlook怎么做,应该在哪里配置呢?
    猜你喜欢
    • 2010-09-23
    • 2014-05-01
    • 1970-01-01
    • 2022-10-01
    • 2010-11-25
    • 2018-11-15
    • 2022-11-20
    • 2018-10-06
    • 1970-01-01
    相关资源
    最近更新 更多