Created
August 22, 2013 11:38
-
-
Save vesan/6306123 to your computer and use it in GitHub Desktop.
Sending emails with different locale than the current user has.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActionMailerLocalizationHelpers | |
def using_locale(locale, &block) | |
original_locale = I18n.locale | |
I18n.locale = locale | |
return_value = yield | |
I18n.locale = original_locale | |
return_value | |
end | |
end | |
ActionMailer::Base.send(:include, ActionMailerLocalizationHelpers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment