{"id":30794019,"url":"https://github.com/sendgrid/sendgrid-parse-api-example","last_synced_at":"2025-09-05T16:26:54.368Z","repository":{"id":10696987,"uuid":"12940111","full_name":"sendgrid/sendgrid-parse-api-example","owner":"sendgrid","description":"Example application using the SendGrid Parse API.","archived":false,"fork":false,"pushed_at":"2024-02-10T05:34:43.000Z","size":132,"stargazers_count":45,"open_issues_count":5,"forks_count":19,"subscribers_count":199,"default_branch":"master","last_synced_at":"2024-04-08T17:29:21.684Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sendgrid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2013-09-19T03:37:08.000Z","updated_at":"2024-03-20T12:07:35.000Z","dependencies_parsed_at":"2024-02-03T01:24:58.137Z","dependency_job_id":"9f6b9bcf-bd6a-4b7b-b966-99273db97230","html_url":"https://github.com/sendgrid/sendgrid-parse-api-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sendgrid/sendgrid-parse-api-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendgrid%2Fsendgrid-parse-api-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendgrid%2Fsendgrid-parse-api-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendgrid%2Fsendgrid-parse-api-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendgrid%2Fsendgrid-parse-api-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sendgrid","download_url":"https://codeload.github.com/sendgrid/sendgrid-parse-api-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sendgrid%2Fsendgrid-parse-api-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273782770,"owners_count":25167217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-05T16:26:48.959Z","updated_at":"2025-09-05T16:26:54.359Z","avatar_url":"https://github.com/sendgrid.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sendgrid-parse-api-example\n\n![](https://raw.githubusercontent.com/sendgrid/sendgrid-parse-api-example/master/sendgrid-parse-api-example.png)\n\nExample application using the SendGrid Parse API. \n\nThis application demonstrates how to use SendGrid's Parse API. Additionally, it acts as a boilerplate of code that you can adjust to your own needs. It comes with complete instructions for getting the SendGrid Parse API working.\n\n## Getting Started\n\nYou will need [an account on SendGrid](https://sendgrid.com/user/signup).\n\n### Production\n\n#### 1. Deploy to Heroku\n\nClick this button to deploy to Heroku.\n\n[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)\n\n#### 2. Check for 200 OK\n\nThen you should be able to run the following - receiving a success 200 response.\n\n```\n$ curl -I -X POST http://your-heroku-subdomain.herokuapp.com/inbound\n```\n\n#### 3. Set SendGrid Parse Settings\n\nNext, setup your [SendGrid Parsing Incoming Emails setting](http://sendgrid.com/developer/reply) like the following but with a hostname of your own and the url you deployed this app to. (You'll notice I actually made my hostname a subdomain `m.carve.io`. You can do the same or the more standard root of your domain.) \n\n![](https://raw.github.com/sendgrid/sendgrid-parse-api-example/master/readme/inbound1.png)\n\n#### 4. Configure Your MX Records\n\nNow you have to configure an MX record on the hostname you set above. It should look something like the following.\n\n![](https://raw.github.com/sendgrid/sendgrid-parse-api-example/master/readme/inbound2.png)\n\nNow wait a couple hours to 48 hours. (It can take up to 48 hours for MX records to propagate around the world.)\n\n#### 5. Send an Email\n\nSend an email to `inbound@the-hostname-you-setup.com` and this app will now parse it. \n\nIt will deliver an email back to you with an attachment containing the content of the webhook data. The contents will look something [like this](https://gist.github.com/scottmotte/6642578/raw/d66d703abdd45addec9e8ff7aa92214db7dda326/gistfile1.txt).\n\n#### 6. Adjust the code\n\nYou can now adjust the code in [routes/inbound.js](https://github.com/sendgrid/sendgrid-parse-api-example/blob/master/routes/inbound.js) to do whatever logic you require.\n\n### Development\n\n#### 1. Set ENV vars \n\n```\n$ mv .env.example .env\n```\n\nChange the contents of .env to your username and password.\n\n```\nSENDGRID_USERNAME=your_sendgrid_username\nSENDGRID_PASSWORD=your_sendgrid_password\n```\n\n#### 2. Run App\n\n```\n$ npm install\n$ node app.js\n```\n\n#### 3. Setup ngrok\n\nDetailed [install instructions here](https://ngrok.com/).\n\n```\n$ wget https://dl.ngrok.com/darwin_amd64/ngrok.zip\n$ unzip ngrok.zip -d /usr/local/bin\n$ ngrok 3000\n```\n\nNote the url the `ngrok` command gives you. \n\n#### 4. Set SendGrid Parse Settings\n\nNext, setup your [SendGrid Parsing Incoming Emails setting](http://sendgrid.com/developer/reply) like the following but with a hostname of your own and the url granted to you from the `ngrok` command above plus the /inbound path.  \n\n![](https://raw.github.com/sendgrid/sendgrid-parse-api-example/master/readme/inbound3.png)\n\n#### 5. Configure Your MX Records\n\nNow you have to configure an MX record on the hostname you set above. It should look something like the following.\n\n![](https://raw.github.com/sendgrid/sendgrid-parse-api-example/master/readme/inbound2.png)\n\nWait 1-48 hours. (It can take up to 48 hours for MX records to propagate around the world.)\n\n#### 6. Send an Email\n\nSend an email to `inbound@the-hostname-you-setup.com` and this app will now parse it. \n\nIt will deliver an email back to you with an attachment containing the content of the webhook data. The contents will look something [like this](https://gist.github.com/scottmotte/6642578/raw/d66d703abdd45addec9e8ff7aa92214db7dda326/gistfile1.txt).\n\n\n\n## Alternatives\n\nIf you just need a quick way to inspect the payload contents of the Parse API webhook, I recommend using one of the following. You'll still have to setup your MX records.\n\n* [RequestBin](http://requestb.in/)\n* [HookDebug](hookdebug.sendgrid.com)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsendgrid%2Fsendgrid-parse-api-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsendgrid%2Fsendgrid-parse-api-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsendgrid%2Fsendgrid-parse-api-example/lists"}