Files
openfoodnetwork/app/mailers/payment_mailer.rb
Jean-Baptiste Bellet bcd306ebd4 Authorize payment email could be send to guest user
Always send the email to the order.email value
2022-02-17 09:40:28 +01:00

27 lines
825 B
Ruby

# frozen_string_literal: true
class PaymentMailer < Spree::BaseMailer
include I18nHelper
def authorize_payment(payment)
@payment = payment
subject = I18n.t('spree.payment_mailer.authorize_payment.subject',
distributor: @payment.order.distributor.name)
I18n.with_locale valid_locale(@payment.order.user) do
mail(to: payment.order.email, from: from_address, subject: subject)
end
end
def authorization_required(payment)
@payment = payment
shop_owner = @payment.order.distributor.owner
subject = I18n.t('spree.payment_mailer.authorization_required.subject',
order: @payment.order)
I18n.with_locale valid_locale(shop_owner) do
mail(to: shop_owner.email,
from: from_address,
subject: subject)
end
end
end