Skip to content

Commit

Permalink
Merge pull request #24 from MONEI/move_send_main_on_success
Browse files Browse the repository at this point in the history
Move send main on success
  • Loading branch information
jcuervas authored Jul 6, 2023
2 parents 0f136e1 + fa83b5f commit adc372b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
1 change: 1 addition & 0 deletions Observer/SendMailOnOrderSuccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
$this->checkoutSession->setForceOrderMailSentOnSuccess(true);
$order = $this->orderModel->create()->load($orderIds[0]);
$this->orderSender->send($order, true);
$this->checkoutSession->unsForceOrderMailSentOnSuccess();
}
}
}
1 change: 0 additions & 1 deletion Plugin/Sales/Order/Email/Container/OrderIdentityPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public function aroundIsEnabled(\Magento\Sales\Model\Order\Email\Container\Order
else
$returnValue = true;

$this->checkoutSession->unsForceOrderMailSentOnSuccess();
}

return $returnValue;
Expand Down
3 changes: 3 additions & 0 deletions etc/events.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<event name="sales_order_invoice_register">
<observer name="set_monei_order_status_and_state_after_invoice" instance="Monei\MoneiPayment\Observer\SetOrderStatusAfterInvoice"/>
</event>
<event name="checkout_onepage_controller_success_action">
<observer name="checkout_onepage_controller_success_action_sendmail" instance="Monei\MoneiPayment\Observer\SendMailOnOrderSuccess" />
</event>
<!-- <event name="sales_order_creditmemo_refund">-->
<!-- <observer name="set_monei_order_status_and_state_after_refund" instance="Monei\MoneiPayment\Observer\SetOrderStatusAfterRefund"/>-->
<!-- </event>-->
Expand Down
10 changes: 0 additions & 10 deletions etc/frontend/events.xml

This file was deleted.

0 comments on commit adc372b

Please sign in to comment.