From 3aba88ef4d5596f3e131f5b0afb42adcd0d44823 Mon Sep 17 00:00:00 2001 From: Jorn Bakker Date: Wed, 8 Aug 2018 14:23:20 +0200 Subject: [PATCH] Send mail on authorize state --- app/code/community/Pay/Payment/Helper/Order.php | 15 +++++++++++++++ app/code/community/Pay/Payment/etc/config.xml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/code/community/Pay/Payment/Helper/Order.php b/app/code/community/Pay/Payment/Helper/Order.php index 08c2e4e..edbe463 100644 --- a/app/code/community/Pay/Payment/Helper/Order.php +++ b/app/code/community/Pay/Payment/Helper/Order.php @@ -315,6 +315,21 @@ public function updateState( $transactionSave->save(); } + $sendMail = $store->getConfig('payment/' . $payment->getMethod() . '/send_mail'); + $sendStatusupdates = $store->getConfig('pay_payment/general/send_statusupdates'); + if ($sendMail == 'start') { + // De bevestigingsmail is al verstuurd, we gaan alleen de update sturen + if ($sendStatusupdates) { + $order->sendOrderUpdateEmail(); + } + } else { + // De bevestigingsmail is nog niet verstuurd, dus doen we het nu + if ( ! $order->getEmailSent()) { + $order->sendNewOrderEmail(); + $order->setEmailSent(true); + } + } + $auth_transaction->setIsClosed(0); $auth_transaction->save(); $payment->save(); diff --git a/app/code/community/Pay/Payment/etc/config.xml b/app/code/community/Pay/Payment/etc/config.xml index 918ed0f..6cbb920 100644 --- a/app/code/community/Pay/Payment/etc/config.xml +++ b/app/code/community/Pay/Payment/etc/config.xml @@ -2,7 +2,7 @@ - 3.12.8 + 3.12.9