Open nratter opened 2 years ago
@nratter For sure. Here's how I use it for that purpose:
# controller.rb
def email
@issue = Issue.find(params[:issue_id])
respond_to do |format|
format.text { render :layout => false }
format.mjml { render :layout => false }
end
end
# email.mjml
<mjml>
<mj-head>
<mj-preview><%= "The #{@issue.release.strftime("%B %Y")} issue of New Internationalist has been published.</mj-preview>
</mj-head>
...
I'm looking to build a client-side 'preview' of an email using this library. Since mjml runs on the server, is there a way we can use this library to generate an html string that can then be used to pass to the client?