Comment on Rails 4.1.0 beta1 releasedComments−gfodor12ywow, the action mailer preview thing is one of those things you're amazed didn't exist until now. i remember rigging this up manually a few times after getting sick of sending a million test emails to myself. great work rails team!−joshdotsmith12y37signals actually has a gem called mail_view that I've been using to preview mailers: https://github.com/37signals/mail_viewGlad this made it into Rails itself.And if you've ever wanted to put inline CSS into emails, roadie will help with that: https://github.com/Mange/roadie−dboyd12yHat-tip to roadie. I am absolutely amazed at how well it works, and how much work it removes in producing HTML emails.−alexvay12yWhat is the template engine used to parse https://github-camo.global.ssl.fastly.net/c58b91097c12fa39e4... ?−mikeatlas12yThe letter_opener gem is pretty handy to avoid that: https://github.com/ryanb/letter_openerOr, you could easily just create controller actions which render your emails as well:@body = mail.body.parts[1].html_part.body.raw_sourcerender '/mailer_notification/preview.html', :layout => falseAnd in preview.html.erb: <%= raw(@body) %>−purephase12yI used mailcatcher. It's pretty awesome for this stuff, but glad to see it in core.
Comments
wow, the action mailer preview thing is one of those things you're amazed didn't exist until now. i remember rigging this up manually a few times after getting sick of sending a million test emails to myself. great work rails team!
37signals actually has a gem called mail_view that I've been using to preview mailers: https://github.com/37signals/mail_view
Glad this made it into Rails itself.
And if you've ever wanted to put inline CSS into emails, roadie will help with that: https://github.com/Mange/roadie
Hat-tip to roadie. I am absolutely amazed at how well it works, and how much work it removes in producing HTML emails.
What is the template engine used to parse https://github-camo.global.ssl.fastly.net/c58b91097c12fa39e4... ?
The letter_opener gem is pretty handy to avoid that: https://github.com/ryanb/letter_opener
Or, you could easily just create controller actions which render your emails as well:
@body = mail.body.parts[1].html_part.body.raw_source
render '/mailer_notification/preview.html', :layout => false
And in preview.html.erb: <%= raw(@body) %>
I used mailcatcher. It's pretty awesome for this stuff, but glad to see it in core.