rails/rails — pull request #9046 by exviva (2013-01-23 18:26:44+00:00)
Title: Add a `:subject_interpolations` option to `ActionMailer::Base#mail`

It allows to have a properly scoped default I18n subject, but with interpolations, which
will be populated from the `:subject_interpolations` hash, e.g.:

# config/locales/en.yml
en:
user_mailer:
welcome:
subject: 'Hello, %{username}'

# app/mailers/user_mailer.rb
class UserMailer < ActionMailer::Base
def welcome(user)
mail(subject_interpolations: {username: user.name})
end
end

I was also thinking of not introducing a new option, but use the `:subject` option, but detect if it's a Hash, and if so, pass it as interpolations to the default i18n subject.

As usual, open for feedback.