.

Mailgun on Heroku Sending Error



Posted on

I’m on my honeymoon, but the hubs is out doing touristy stuff in a car on bumpy sand dunes, which would be a one way ticket for me to puke-town. I get really bad car sickness, especially on bumpy roads.

So obviously I took this opportunity to

  1. update his OS on his netbook, because omg.
  2. create an account for me on there, because his settings are: spanish keyboard german chrome. Making Hell OS even more hell
  3. learn more rails

I thought I had followed the setup instructions for mailgun on heruko properly

I set up my sending email, configured my environment.rb file to use mailgun and was still getting an error on my herokuapp domain when sending. No log activity at all was being recorded.

  1. It turns out that when I log into heroku and click the app for mailgun there, it’s different to logging in directly to mailgun and creating an account there. On mailgun website, I create a separate account for me to use there, and then verify that account and add the sending email – basically all the steps I already did on the heroku website and assumed where mirrored. The difference was my account was now verified to send mail.
  2. That done, I could now send the curl command and see the app was configured correctly.
  3. I hadn’t tested on the dev server because -hey, it couldn’t send email, so what was the point? Right? Wrong. Testing on the dev server showed a nice little error on my form. Or more accurately, my contacts_controller.erb
  4. I couldn’t see what I had typed wrong (and I’m using a keyboard which the keys do not correspond to keyboard layout, so i’m using memory here), so pasted the entire code from the tutorial in to check and tested again. because life is short and git diff exists.
  5. Oh lookie, it works now on dev!
  6. Git push and test on live, and it’s working.

 

So, in summery: set up your mailgun account direct on the mailgun site, not through heroku apps configuration. Always test on dev to make sure you haven’t messed up something basic.

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Stay in touch

Get more informal notes, summaries, and screenshots, on the business of making digital products and running a calm creative business by signing up to my newsletter