Files
openfoodnetwork/app/mailers/backorder_mailer.rb
Maikel Linke 74c80c9fff Prepare BackorderJob for stock controlled items
We want to trigger the backordering for any linked product now. So let's
do that check early and then select the variants in the background.
It means less data passed to the job and less space for race conditions.
2024-10-03 13:28:20 +10:00

25 lines
551 B
Ruby

# frozen_string_literal: true
class BackorderMailer < ApplicationMailer
include I18nHelper
def backorder_failed(order)
@order = order
@linked_variants = order.variants
I18n.with_locale valid_locale(order.distributor.owner) do
mail(to: order.distributor.owner.email)
end
end
def backorder_incomplete(user, distributor, order_cycle, order_id)
@distributor = distributor
@order_cycle = order_cycle
@order_id = order_id
I18n.with_locale valid_locale(user) do
mail(to: user.email)
end
end
end