Skip to content

Comment on Rails 4.1.0 beta1 released

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.

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.