Skip to content

Commit 93fd612

Browse files
committed
Add default locale handling
1 parent 23f0be6 commit 93fd612

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

app/mailers/application_mailer.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class ApplicationMailer < ActionMailer::Base
1111

1212
layout "mailer"
1313

14+
around_action :use_default_locale
1415
after_deliver :record_delivery
1516

1617
def record_delivery
@@ -26,4 +27,10 @@ def record_delivery
2627
mailer: mailer_name)
2728
end
2829
end
30+
31+
private
32+
33+
def use_default_locale(&block)
34+
I18n.with_locale(I18n.default_locale, &block)
35+
end
2936
end

0 commit comments

Comments
 (0)