Forwarding Inbound Emails sendgrid

1.6k Views Asked by At

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!

1

There are 1 best solutions below

0
On BEST ANSWER

Use the "reply_to" from SendGrid.

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. Set the reply_to to "[email protected]".
  2. "[email protected]" is a real email address you own and control, not part of SendGrid. Setup that account to forward emails being sent to it to automatically forward to "[email protected]".