How to use my view helpers in my ActionMailer views?

I want to use the methods I defined in app/helpers/annotations_helper.rb in my ReportMailer views (app/views/report_mailer/usage_report.text.html.erb). How do I do this?

Based on this guide it seems like the add_template_helper(helper_module) method might do what I want, but I can’t figure out how to use it.

(BTW, is there a reason you get access to a different set of helpers in mailer views? This is pretty annoying.)

8 Answers
8

Leave a Comment