mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-29 21:17:17 +00:00
29 lines
852 B
Ruby
29 lines
852 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.user.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
|