Reputation: 8158
I have a Rails app running on Heroku that uses Mailgun to process incoming emails. I haven't been able to figure how I can debug my email processing locally (on localhost) instead of having to push everything up to heroku every time I make a change. (this is just a test app - I'm the only one using it)
Is it possible to work with Mailgun locally? If so, how do I go about it?
Thank you in advance
Upvotes: 5
Views: 8158
Reputation: 966
using this gem might be another possible solution:
https://github.com/ryanb/letter_opener/ or https://github.com/fgrehm/letter_opener_web for more advanced features
Upvotes: 0
Reputation: 419
mailgun provides a sandbox that you can use for localhost the only downside to this is that you have to add the test email to valid recipient.
Upvotes: 1
Reputation: 18803
Mailgun gives you the option to store a message for later retrieval. If you configure it that way, you'll be able to fetch messages from development for processing without having to set up a publicly-accessible webhook for Mailgun to hit.
But I'm assuming you have production configured with an HTTP endpoint, and it's no fun to do things differently between environments. There are a few tools that will let you set up a public endpoint that routes to localhost
:
If you have a permanent publicly-accessible server, you can also maintain your own tunnel.
Upvotes: 12