rails/rails — pull request #9514 by shaiguitar (2013-03-02 02:27:05+00:00)
Title: Interceptor for activemailer does not work well with rendering I18n

Hey,

I've been trying to modify the I18n.locale setting so that it sends an email with the correct locale in the template (such as implicit_with_locale.pl.text.erb in the fixtures).

However, this doesn't work correctly if I modify it in an ActiveMailer interceptor because the call stack is not in the right order.

The pull request here is only a failing spec to demonstrate this behavior, but I first wanted to confirm if that is intentional behavior, or perhaps something that was just overlooked?

It would be very useful if the interceptor was fired before the rendering of the template itself (in order to set I18n.locale, for example).

Thoughts? Ideas?

Thank you!