6

How do I access helpers within ActionMailer from ones I have created?

I have tried: How to use my view helpers in my ActionMailer views? for my own created helper but didn't work. Any advise?

Community
  • 1
  • 1
Lee
  • 20,034
  • 23
  • 75
  • 102

1 Answers1

8

This has worked for me in the past in Rails 3:

class OrderMailer < ActionMailer::Base
  helper :application, :orders, :products
  ...
end

My custom helpers are obviously orders and products.

twmills
  • 2,985
  • 22
  • 20