Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using helpers in ActionMailer

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?

like image 293
Lee Avatar asked May 10 '11 21:05

Lee


1 Answers

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.

like image 171
twmills Avatar answered Sep 18 '22 00:09

twmills