aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer/lib/action_mailer/base.rb')
-rw-r--r--actionmailer/lib/action_mailer/base.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index 4a935de5d6..20911513d0 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -240,13 +240,17 @@ module ActionMailer #:nodoc:
private
def render_message(method_name, body)
- ActionView::Base.new(template_path, body).render_file(method_name)
+ initialize_template_class(body).render_file(method_name)
end
def template_path
template_root + "/" + Inflector.underscore(self.class.name)
end
+ def initialize_template_class(assigns)
+ ActionView::Base.new(template_path, assigns, self)
+ end
+
def create_mail
m = TMail::Mail.new
@@ -305,6 +309,8 @@ module ActionMailer #:nodoc:
case method_symbol.id2name
when /^create_([_a-z]\w*)/ then new($1, *parameters).mail
when /^deliver_([_a-z]\w*)/ then new($1, *parameters).deliver!
+ when "new" then nil
+ else super
end
end