Reputation: 151
I have a node.js app that uses the sendgrid api to send emails.
I want people to be able to reply to those, and then forward the reply to another email. E.G:
[email protected]
sends automated email to [email protected]
.
blop replies, "hello",
and I want the email containing "hello" to be forwarded to another email, such as [email protected].
(Or something like that)
I have done some research and all I can find is using parse webhooks
(whatever those are :] ) to send POST requests to a server when an inbound email is detected.
What I dont understand is why (if you can do that), you cant simply forward it to another email.
If there is no way to forward them, is there some node module that could accept the POST request and then forward it? Thank you in advance!
Upvotes: 0
Views: 2038
Reputation:
Use the "reply_to" from SendGrid.
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"}}'
reply_to
to "[email protected]".Upvotes: 2