Now we have to do is set up a new parse endpoint on SendGrid. To do this, you'll need to make sure your app is accessible from the web. You could deploy it somewhere like
heroku or use the awesome
localtunnel gem to expose your local development environment to the web.
You'll also need a domain with it's MX record pointing at mx.sendgrid.net. If you don't know how to do this part, check with your domain's hosting provider for details.
Head over to the
Parse Webhook settings page and create a new record. Your hostname should be your url and the url should point to your app's email processing endpoint. Griddler adds "/email_processor" as a route on your application. So, if your app is hosted at http://example.com, then the url would be "http://example.com/email_processor".
That's it! We've just integrated incoming email support into our sample application. Now every time you send an email to an email address at your domain, a new post gets created with the email's body and the from email address.
Of course, just like many of ThoughtBot's other awesome libraries, Griddler is open source. You can find the
source code on Github, so be sure to check it out!