summaryrefslogtreecommitdiff
path: root/app/mailers
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2017-05-25 10:22:45 -0500
committerRuben Davila <rdavila84@gmail.com>2017-05-25 10:22:45 -0500
commit5c921809cd86e1031a6a5075da142fef3bb01d6d (patch)
tree0c04cf9d24f9e94c2bf5dfd709c22f142bec5e77 /app/mailers
parentd07e85e1033f8026f155c6171cb3ebcd6b93d9ed (diff)
downloadgitlab-ce-5c921809cd86e1031a6a5075da142fef3bb01d6d.tar.gz
Bugfix: Always use the default language when generating emails.32748-emails-are-being-sent-with-the-wrong-language
There was a race condition issue when the application was generating an email and was using a language that was previously being used in other request.
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/base_mailer.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/mailers/base_mailer.rb b/app/mailers/base_mailer.rb
index d2980db218a..654468bc7fe 100644
--- a/app/mailers/base_mailer.rb
+++ b/app/mailers/base_mailer.rb
@@ -1,4 +1,6 @@
class BaseMailer < ActionMailer::Base
+ around_action :render_with_default_locale
+
helper ApplicationHelper
helper MarkupHelper
@@ -14,6 +16,10 @@ class BaseMailer < ActionMailer::Base
private
+ def render_with_default_locale(&block)
+ Gitlab::I18n.with_default_locale(&block)
+ end
+
def default_sender_address
address = Mail::Address.new(Gitlab.config.gitlab.email_from)
address.display_name = Gitlab.config.gitlab.email_display_name