Skip to content

Commit

Permalink
Send mail on authorize state
Browse files Browse the repository at this point in the history
  • Loading branch information
jornBakery committed Aug 8, 2018
1 parent 7f5b1d9 commit 3aba88e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions app/code/community/Pay/Payment/Helper/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Pay/Payment/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Pay_Payment>
<version>3.12.8</version>
<version>3.12.9</version>
</Pay_Payment>
</modules>
<global>
Expand Down

0 comments on commit 3aba88e

Please sign in to comment.