[英]How to receive, process, and send an email using Cloud Function, and Mail API?
I am trying to create a basic application to do the following using GCP: 我正在尝试创建一个基本的应用程序以使用GCP执行以下操作:
For example: 例如:
example@example.com
sends an email with Subject Process this
and Email body Hello
to the Google service account . example@example.com
向Google服务帐户发送一封电子邮件,其中包含“主题Process this
,电子邮件正文“ Hello
”。 The python program ( Cloud functions ) will programmatically read the email body as string, append world!
python程序( Cloud函数 )将以编程方式将电子邮件正文读取为字符串,追加world!
, then send Hello world!
,然后发送Hello world!
to the example@example.com
as email body with subject Processed!
作为主题的电子邮件正文发送到example@example.com
Processed!
. 。
I have added example@example.com
to Mail API Authorised Senders . 我已将example@example.com
添加到Mail API授权的发件人 。
I found these GitHub code to send and receive email. 我发现这些GitHub代码可以发送和接收电子邮件。
How do I use these in cloud functions to actively look for incoming email and respond with a appropriate email with respect to my process? 如何在云功能中使用这些功能来主动查找传入的电子邮件并针对我的流程以适当的电子邮件进行响应?
As I understand your problem is that you don't know how to trigger you Cloud Function. 据我了解,您的问题是您不知道如何触发云功能。 In this case I would suggest you to read Google's documentation about calling a Cloud Function . 在这种情况下,建议您阅读有关调用Cloud Function的 Google文档。
In your case, you could use this Third Party API . 就您而言,您可以使用此第三方API 。 What this API does is when you receive an e-mail, it sends an HTTP POST request with all the information that are included in the e-mail. 此API的作用是当您收到电子邮件时,它会发送HTTP POST请求以及该电子邮件中包含的所有信息。 This HTTP request will trigger your function. 此HTTP请求将触发您的功能。
Let me know if it was helpful. 让我知道是否有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.