Rails: test post to localhost

I have a Rails application running on Heroku that uses Mailgun to handle incoming emails. I have not been able to figure out how I can debug the email handling locally (on localhost) instead of pushing everything to heroku every time I make a change. (this is just a test app - I only use it)

Can I work with Mailgun locally? If so, how should I do this?

Thank you in advance

+3


source to share


2 answers


Mailgun gives you the option to save a message for later retrieval . If you configure it this way, you will be able to receive emails from development for processing without having to set up a public web check for Mailgun.

But I am assuming that you are in the mood with an HTTP endpoint and you are not good at doing anything different between environments. There are several tools that will allow you to set up a public endpoint that is sent to localhost

:



  • ngrok which I used for good effect the Twilio test . You can set up a persistent subdomain so you don't have to constantly change your Mailgun configuration.
  • UltraHook , which I haven't personally used, but looks the same.
  • Localtunnel which looks the easiest to run, but how do you get different hosts on each boot.

If you have a persistent public server, you can also keep your own tunnel .

+7


source


mailgun provides a sandbox that you can use for localhost, the only downside to this is that you need to add a test email to the actual recipient.



0


source







All Articles