aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/base.rb
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-06-16 11:39:29 +0000
committerJamis Buck <jamis@37signals.com>2005-06-16 11:39:29 +0000
commit5ec990af9e348e245b6583c49bba90a00e50c6db (patch)
tree8ebf209203296d8b5f0671d771bab0e46af6cb77 /actionmailer/lib/action_mailer/base.rb
parentc2ed453880539fbc27fc0e00a95fbcf9949d0ed6 (diff)
downloadrails-5ec990af9e348e245b6583c49bba90a00e50c6db.tar.gz
rails-5ec990af9e348e245b6583c49bba90a00e50c6db.tar.bz2
rails-5ec990af9e348e245b6583c49bba90a00e50c6db.zip
Helper support for ActionMailer
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1446 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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