aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/base.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-01-25 04:23:06 -0800
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-01-25 04:23:06 -0800
commit01341e3e432f0602891fe226ed1f2d079f590327 (patch)
treec946af83d94e061c93124733dd8d2efc40956429 /actionmailer/lib/action_mailer/base.rb
parent9826823e665e612f0a166da6b2f8e5007183400b (diff)
parent57bfbc249e2af753163788d07ac7a658b4f5484a (diff)
downloadrails-01341e3e432f0602891fe226ed1f2d079f590327.tar.gz
rails-01341e3e432f0602891fe226ed1f2d079f590327.tar.bz2
rails-01341e3e432f0602891fe226ed1f2d079f590327.zip
Merge pull request #9046 from exviva/actionmailer_subject_interpolations
Allow passing interpolations to #default_i18n_subject in mailers
Diffstat (limited to 'actionmailer/lib/action_mailer/base.rb')
-rw-r--r--actionmailer/lib/action_mailer/base.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index 9ba606c045..c4d2950abd 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -726,9 +726,10 @@ module ActionMailer
# Translates the +subject+ using Rails I18n class under <tt>[mailer_scope, action_name]</tt> scope.
# If it does not find a translation for the +subject+ under the specified scope it will default to a
# humanized version of the <tt>action_name</tt>.
- def default_i18n_subject #:nodoc:
+ # If the subject has interpolations, you can pass them through the +interpolations+ parameter.
+ def default_i18n_subject(interpolations = {})
mailer_scope = self.class.mailer_name.tr('/', '.')
- I18n.t(:subject, scope: [mailer_scope, action_name], default: action_name.humanize)
+ I18n.t(:subject, interpolations.merge(scope: [mailer_scope, action_name], default: action_name.humanize))
end
def collect_responses(headers) #:nodoc: