use locale in mails
Conflicts: app/workers/supplier_notifier.rb app/workers/user_notifier.rb
This commit is contained in:
parent
2d1a55c2f7
commit
71a922a034
1 changed files with 6 additions and 2 deletions
|
@ -13,7 +13,9 @@ class UserNotifier
|
||||||
Order.find(order_id).group_orders.each do |group_order|
|
Order.find(order_id).group_orders.each do |group_order|
|
||||||
group_order.ordergroup.users.each do |user|
|
group_order.ordergroup.users.each do |user|
|
||||||
begin
|
begin
|
||||||
|
I18n.with_locale(user.settings['profile']['language']) do
|
||||||
Mailer.order_result(user, group_order).deliver if user.settings.notify["order_finished"]
|
Mailer.order_result(user, group_order).deliver if user.settings.notify["order_finished"]
|
||||||
|
end
|
||||||
rescue
|
rescue
|
||||||
Rails.logger.warn "Can't deliver mail to #{user.email}"
|
Rails.logger.warn "Can't deliver mail to #{user.email}"
|
||||||
end
|
end
|
||||||
|
@ -29,7 +31,9 @@ class UserNotifier
|
||||||
|
|
||||||
Ordergroup.find(ordergroup_id).users.each do |user|
|
Ordergroup.find(ordergroup_id).users.each do |user|
|
||||||
begin
|
begin
|
||||||
|
I18n.with_locale(user.settings['profile']['language']) do
|
||||||
Mailer.negative_balance(user, transaction).deliver if user.settings.notify["negative_balance"]
|
Mailer.negative_balance(user, transaction).deliver if user.settings.notify["negative_balance"]
|
||||||
|
end
|
||||||
rescue
|
rescue
|
||||||
Rails.logger.warn "Can't deliver mail to #{user.email}"
|
Rails.logger.warn "Can't deliver mail to #{user.email}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue