Fix rails mailer preview not honouring locale (#28418)

th-downstream
Matt Jankowski 11 months ago committed by GitHub
parent 476d1237d4
commit 7cfc078198
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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!

@ -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

Loading…
Cancel
Save