Use the default locale when sending mails to suppliers

This commit is contained in:
Patrick Gansterer 2019-01-23 23:00:33 +01:00
parent d925533366
commit 63e1541aa3
2 changed files with 9 additions and 1 deletions

View file

@ -125,6 +125,12 @@ class Mailer < ActionMailer::Base
end
end
def self.deliver_now_with_default_locale(&block)
I18n.with_locale(FoodsoftConfig[:default_locale]) do
self.deliver_now &block
end
end
def self.deliver_now
message = yield
message.deliver_now