转发入站电子邮件 sendgrid

问题描述

我有一个 node.js 应用程序,它使用 sendgrid api 发送电子邮件。 我希望人们能够回复这些内容,然后将回复转发到另一封电子邮件。例如: [email protected] 自动[email protected] 发送电子邮件

blop 回复“你好”, 我希望将包含“hello”的电子邮件转发到另一封电子邮件,例如 [email protected]。 (或类似的东西) 我已经做了一些研究,我能找到的只是在检测到入站电子邮件时使用 parse webhooks(无论是什么 :] )向服务器发送 POST 请求。

我不明白为什么(如果你能做到),你不能简单地将它转发到另一封电子邮件

如果没有办法转发,有没有节点模块可以接受POST请求然后转发? 提前致谢!

解决方法

使用 SendGrid 中的“reply_to”。

https://sendgrid.com/docs/for-developers/sending-email/api-getting-started/#send-your-email-using-the-api

curl --request POST \
--url https://api.sendgrid.com/v3/mail/send \
--header 'Authorization: Bearer <<YOUR_API_KEY>>' \
--header 'Content-Type: application/json' \
--data '{"personalizations":[{"to":[{"email":"[email protected]","name":"John Doe"}],"subject":"Hello,World!"}],"content": [{"type": "text/plain","value": "Heya!"}],"from":{"email":"[email protected]","name":"Sam Smith"},"reply_to":{"email":"[email protected]","name":"Sam Smith"}}'
  1. reply_to 设置为“[email protected]”。
  2. [email protected]”是您拥有和控制的真实电子邮件地址,而不是 SendGrid 的一部分。设置该帐户以转发发送给它的电子邮件以自动转发到“[email protected]”。