Fix rails mailer preview not honouring locale (#28418)

This commit is contained in:
Matt Jankowski authored and GitHub committed 2023-12-18 21:49:17 +00:00
1 parent 476d1237d4
commit 7cfc078198
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ class ApplicationMailer < ActionMailer::Base
protected
def locale_for_account(account, &block)
I18n.with_locale(account.user_locale || I18n.default_locale, &block)
I18n.with_locale(account.user_locale || I18n.locale || I18n.default_locale, &block)
end
def set_autoreply_headers!
+1 -1
View File
@@ -202,6 +202,6 @@ class UserMailer < Devise::Mailer
end
def locale
@resource.locale.presence || I18n.default_locale
@resource.locale.presence || I18n.locale || I18n.default_locale
end
end