How to receive and parse email with Cloud Functions?

前端 未结 2 947
名媛妹妹
名媛妹妹 2021-01-02 22:34

Google Cloud Functions allows you to easily activate a function upon a trigger (eg Firebase data change, HTTP request...).

I am looking for a way to execute a functi

2条回答
  •  自闭症患者
    2021-01-02 23:19

    Google Cloud Functions does not provide a permanent listener on an endpoint. There is also no event source for SMTP, which is the protocols involved with email delivery. So you can't simple respond to emails as they come in with Cloud Functions at the moment.

    What you can do is direct the traffic to an existing SMTP server, and then use Cloud Functions to read from there at an interval.

    An alternative is to use the Sendgrid Inbound Email API, which can call a webhook for every message it receives. And your webhook would then be a HTTP triggered Cloud Function.

提交回复
热议问题