about summary refs log tree commit diff
path: root/app/mailers/application_mailer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/mailers/application_mailer.rb')
-rw-r--r--app/mailers/application_mailer.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb
index e5dbfeeda..2e730c19b 100644
--- a/app/mailers/application_mailer.rb
+++ b/app/mailers/application_mailer.rb
@@ -4,4 +4,12 @@ class ApplicationMailer < ActionMailer::Base
   default from: ENV.fetch('SMTP_FROM_ADDRESS') { 'notifications@localhost' }
   layout 'mailer'
   helper :instance
+
+  protected
+
+  def locale_for_account(account)
+    I18n.with_locale(account.user_locale || I18n.default_locale) do
+      yield
+    end
+  end
 end