You are here: Home Solidarrow Ruby on Rails Solidarrow Cheatsheets

* ActionMailer Cheatsheet

ActionMailer is the Rails framework which handles email delivery. This comprehensive cheatsheet will help your email on its way.

URLs

If your view includes URLs from the application, you need to use url_for in the mailer class method instead of in the view template. You can pass the result to the view via the body method. Unlike controllers from ActionPack, the mailer instance doesn't have any context about the incoming request.

    body :home_page => url_for(:host => "dizzy.co.uk", :controller => "welcome", :action => "index")