Sendgrid it's a platform that offers a mail service delivery and the interesting thing it's that we can configure our incoming email service in their platform.
For example: I have my domain danfercf.info and I want to receive my incoming email for the email address firstname.lastname@example.org in my domain and I can do that with Sendgrid, we can receive the emails in Sendgrid's service the service is called "Inbound Parse Webhook".
Before to configure this feature we must configure an authenticated domain, you can follow this:
After that we can continue and we will follow these steps to configure the service:
Add the domain into the settings page:
For this we need to go to:
And then click to "Add Host & URL"
After that we need to configure the input data for our domain
* Receiving Domain: It's the subdomain for our site (We can add some one or just receive the emails for our entire domain).
* Domain: It is the authenticated domain that was configured before.
* Destination URL: This the API URL that's accepts a POST request with the data sended by Sendgrid.
* Check incoming emails for spam: A feature from Sendgrid to check the spam for our incoming emails.
* POST the raw, full MIME message: This is the input data that was send by Sendgrid but such a raw information.
On this part we configure the inputs:
* Receiving Domain: Blank, if we don't have a subdomain.
* Domain: my-domain.info, here we need to add our domain that will receive the incoming emails.
* Destination URL: http://example.com:7000/api/mails, for this input we add our own API url that's receives a multipart/form data and returns a 200 OK status code if everything is going well with the implementation and the data received.
* Check incoming emails for spam: Checked, it's because it useful that Sendgrid checks if we receive spam in our email accounts.
* POST the raw, full MIME message: Unchecked, we don't handle this kind of data.
And that's it, we just click the Add button and our configuration should be saved and we can continue with the implementation for the webhook.
PD: In the next post I will explain how to implement the webhook using NodeJS and MongoDB for save the incoming email.