Use the same template for multiple ActionMailer actions

Posted Over 13 years ago. Visible to the public.

One option is to use partials. Or you can set the @template field to the name of another action:

class Mailer < ActionMailer::Base
  def foo
    subject "Hello World"
  end
  
  def bar
    subject "Hello Universe"
    @template = 'foo'
  end
end
Henning Koch
Last edit
About 13 years ago
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2010-09-07 08:13)