diff options
author | José Valim <jose.valim@gmail.com> | 2009-10-28 09:22:07 -0200 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-11-01 02:23:49 +0100 |
commit | 2aafdc839600240a55cea06c960d0a2a7f63016d (patch) | |
tree | ae03f403f64cb0e8938bc7c4e5cd373438e9318a /actionmailer/lib/action_mailer | |
parent | 81c416b72e44a75ea74ba342cd223a33f3b80caf (diff) | |
download | rails-2aafdc839600240a55cea06c960d0a2a7f63016d.tar.gz rails-2aafdc839600240a55cea06c960d0a2a7f63016d.tar.bz2 rails-2aafdc839600240a55cea06c960d0a2a7f63016d.zip |
Use I18n on ActionMailer subjects by default.
Diffstat (limited to 'actionmailer/lib/action_mailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 49551dca51..3855ce91c8 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -463,9 +463,9 @@ module ActionMailer #:nodoc: # Create e-mail parts create_parts - # If this is a multipart e-mail add the mime_version if it is not - # already set. - @mime_version ||= "1.0" if !@parts.empty? + # Set the subject if not set yet + @subject ||= I18n.t(method_name, :scope => [:actionmailer, :subjects, mailer_name], + :default => method_name.humanize) # build the mail object itself @mail = create_mail @@ -539,6 +539,10 @@ module ActionMailer #:nodoc: @content_type = "multipart/alternative" if @content_type !~ /^multipart/ @parts = sort_parts(@parts, @implicit_parts_order) end + + # If this is a multipart e-mail add the mime_version if it is not + # already set. + @mime_version ||= "1.0" if !@parts.empty? end end |