title: Using the Mailgun HTTP api from Rails3
body: <p>We are working on changing a Rails 3.2 app to use the <a href="http://www.mailgun.com/" rel="nofollow">Mailgun</a> http api for handling email campaigns.  Currently we are using ActionMailer for building out our templates and sending over smtp but since we want to use some of the more advanced features offered by Mailgun we would rather not deal with all the MIME headers and instead use the REST api.</p>
  
  <p>To render our haml template as a string for the HTTP POST it looks like we either need to use some sort of controller or commit a 'design smell' and invoke the action view from within a model.  Being that the email will be executed by a background worker it doesn't really make sense to call it from a controller; is there some other method that we are missing?</p>