Use the default locale when sending mails to suppliers
This commit is contained in:
parent
d925533366
commit
63e1541aa3
2 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -266,7 +266,9 @@ class Order < ApplicationRecord
|
|||
end
|
||||
|
||||
def send_to_supplier!(user)
|
||||
Mailer.order_result_supplier(user, self).deliver_now
|
||||
Mailer.deliver_now_with_default_locale do
|
||||
Mailer.order_result_supplier(user, self)
|
||||
end
|
||||
update!(last_sent_mail: Time.now)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue