I want to use my mailer_helper methods in my UserMailer class. I’ve added helper :mailer_helper and that works great for the view files. However, they don’t work in the actual mail definitions in UserMailer.rb.
For instance, I can’t use a helper method when defining the mail subject:
mail(to: my_email,
reply_to: someones_email,
subject: "#{helper_method "something"}: Hello!")
How can I get that working?
NOTE
This may seem similar to a question I asked recently, but it’s completely different. In this question, I’m asking about using helper methods that are defined in a helper file that I I’m already successfully using in the mailer views. The other question is about using helper methods defined in a controller.
You can manuelly include your helper in the ActionMailer class you have.