From aa828754c64ddefc3b91adc2af5c813f7a1549ea Mon Sep 17 00:00:00 2001 From: Nishant Vaity Date: Mon, 7 Mar 2022 13:05:24 +0530 Subject: [PATCH 1/2] Send order confirmation email after payment completed successfully --- .../Order/Email/Container/OrderIdentityPlugin.php | 15 ++++++++++++--- etc/di.xml | 5 +++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Plugin/Sales/Order/Email/Container/OrderIdentityPlugin.php b/Plugin/Sales/Order/Email/Container/OrderIdentityPlugin.php index 27130860..17081589 100644 --- a/Plugin/Sales/Order/Email/Container/OrderIdentityPlugin.php +++ b/Plugin/Sales/Order/Email/Container/OrderIdentityPlugin.php @@ -8,16 +8,23 @@ class OrderIdentityPlugin */ protected $checkoutSession; + /** + * @var \Psr\Log\LoggerInterface $logger + */ + protected $logger; + /** * @param \Magento\Checkout\Model\Session $checkoutSession * * @codeCoverageIgnore */ public function __construct( - \Magento\Checkout\Model\Session $checkoutSession + \Magento\Checkout\Model\Session $checkoutSession, + \Psr\Log\LoggerInterface $logger ) { $this->checkoutSession = $checkoutSession; + $this->logger = $logger; } /** @@ -32,9 +39,11 @@ public function aroundIsEnabled(\Magento\Sales\Model\Order\Email\Container\Order $forceOrderMailSentOnSuccess = $this->checkoutSession->getRazorpayMailSentOnSuccess(); if(isset($forceOrderMailSentOnSuccess)) { - $returnValue = $forceOrderMailSentOnSuccess; - $this->checkoutSession->unsRazorpayMailSentOnSuccess(); + // Send order confirmation email after payment completed successfully + $returnValue = (bool)$forceOrderMailSentOnSuccess; } + + $this->logger->info('OrderIdentityPlugin::aroundIsEnabled returnValue:' . $returnValue); return $returnValue; } diff --git a/etc/di.xml b/etc/di.xml index ac7cde72..7bb88bd6 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -50,4 +50,9 @@ RazorpayLogger + + + RazorpayLogger + + From 6f0c45456628049309baf5cad5035408053a692d Mon Sep 17 00:00:00 2001 From: Nishant Vaity Date: Tue, 8 Mar 2022 18:50:29 +0530 Subject: [PATCH 2/2] Send order confirmation email after payment completed successfully --- Plugin/Sales/Order/Email/Container/OrderIdentityPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugin/Sales/Order/Email/Container/OrderIdentityPlugin.php b/Plugin/Sales/Order/Email/Container/OrderIdentityPlugin.php index 17081589..78e7799f 100644 --- a/Plugin/Sales/Order/Email/Container/OrderIdentityPlugin.php +++ b/Plugin/Sales/Order/Email/Container/OrderIdentityPlugin.php @@ -40,7 +40,7 @@ public function aroundIsEnabled(\Magento\Sales\Model\Order\Email\Container\Order if(isset($forceOrderMailSentOnSuccess)) { // Send order confirmation email after payment completed successfully - $returnValue = (bool)$forceOrderMailSentOnSuccess; + $returnValue = $forceOrderMailSentOnSuccess; } $this->logger->info('OrderIdentityPlugin::aroundIsEnabled returnValue:' . $returnValue);