I’m having a bit of trouble deciding how to do this. I am developing a site for a cinema, where newsletters are automatically generated and sent with each week’s movies. Each time a programme is created, a
Newsletter model is created that has a body which contains the HTML for the email. When it’s ready to send it delegates to a Mailchimp wrapper for the actual delivery of the campaign.
Prior to Rails 4.1 I was using
ApplicationController.new.render_to_string(partial: 'movies/movie', movies: movies) to generate the HTML within
Newsletter. This felt hacky but as DRY as possible and better than writing HTML in the model. This has since broken in 4.1 and while there is a fix on the way, I’m wondering if there is a better way to be handling this?