aneesahmadweb@gmail.com     03040836207

    Add below code in file.This will send last order details to customer email.

     $objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
            $orderDatamodel = $objectManager->get('Magento\Sales\Model\Order')->getCollection()->getLastItem();
            $orderId   =   $orderDatamodel->getId();
            //echo $orderId;
    
    
            $objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
    
    
            $checkoutSession = $objectManager->get('\Magento\Checkout\Model\Session');
    
            $orderIdS = $checkoutSession->getLastRealOrder();
            $orderId=$orderIdS->getEntityId();
             $dd=$orderIdS->getIncrementId();
            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $checkout_session = $objectManager->get('Magento\Checkout\Model\Session');
            $order = $checkout_session->getLastRealOrder();
            $orderId= $order->getEntityId();
             $lastorderid=$order->getIncrementId();
    
    
    
    
             $orderid = $lastorderid;
             $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
             $order = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($orderid);
             $objectManager->create('Magento\Sales\Model\OrderNotifier')->notify($order);
    
    
    
    

    About Author

    You may also like

    No Comment

    You can post first response comment.

    Leave A Comment

    Please enter your name. Please enter an valid email address. Please enter a message.