add email template to notify hub that auth is required

This commit is contained in:
Andy Brett
2021-02-03 09:15:40 -08:00
parent 4e3594b8f8
commit c0b3fc301e
7 changed files with 31 additions and 5 deletions

View File

@@ -7,8 +7,22 @@ class PaymentMailer < Spree::BaseMailer
@payment = payment
subject = I18n.t('spree.payment_mailer.authorize_payment.subject',
distributor: @payment.order.distributor.name)
mail(to: payment.order.user.email,
from: from_address,
subject: subject)
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

View File

@@ -0,0 +1,2 @@
= t('spree.payment_mailer.authorization_required.message', order_number: @payment.order.number)
= link_to spree.edit_admin_order_url(@payment.order), spree.edit_admin_order_url(@payment.order)

View File

@@ -0,0 +1,3 @@
= t('spree.payment_mailer.authorization_required.message', order_number: @payment.order.number)
= link_to spree.edit_admin_order_url(@payment.order), spree.edit_admin_order_url(@payment.order)