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.

有帮助吗?

解决方案

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:

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top