Question

I am trying to implement sendgrid parse API using the 'griddler' gem in my rails application. The problem is how can I test it locally? And how to receive email in my local machine.

Was it helpful?

Solution

The are a couple ways to test SendGrid's Parse Webhook locally.

The easiest is to just simulate the Webhook by POSTing data to your endpoint yourself (via cURL or some other mechanism, like Postman [example]). The SendGrid Parse Webhook Docs has an example of the payload that will be posted to your server, so you may mimic that.

The second option, which allows for end-to-end testing rather than just simulation is by creating a tunnel your local machine and provide SendGrid with the URL of the tunnel. There are a number of free services that allow you to do just that very easily:

OTHER TIPS

If I may self-promote, I created a Ruby gem that does this:

https://github.com/ccallebs/pokey-sendgrid

It runs alongside your server and generates SendGrid webhook requests at regular intervals.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top