0

If it is possible to send the old order mail again send to the admin user.

order mail functionality is now working correctly but I have sent old order mail again.

So please anyone tell how to do it in programmatically.

1

you can try this code for sending old order to Admin email.

1) Create a new file in your root directory and paste this code.

ini_set("display_errors",1); define("MAGE_BASE_DIR", "/var/www/magento"); require_once("app/Mage.php"); //require_once MAGE_BASE_DIR . '/app/Mage.php'; Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$orderIncrements = range(100000001, 100000002);

foreach ($orderIncrements as $orderIncrement) { $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrement);

if ($order->getId()) {
    try {
        $order->sendNewOrderEmail();
        echo "Order $orderIncrement successfully sent\n";
    } catch (Exception $e) {
        echo $e->getMessage();
    }
} else {
    echo "Order $orderIncrement not found\n";
}

sleep(2);

}

?>

Hope it's work for you. Thanks

  • Hi @mohit you have order range is only 2 but my requirement is 1000+ orders so how can i do it – Rohit Gohel Sep 30 at 10:56
  • HI @Rohit yes you can be doing that easily like increase the range as you want. like $orderIncrements = range(100000001, 100000102); between range are increase 100 order email send. – MOHIT Sep 30 at 10:58
  • oh kk good but you have any other reference link to do that this question so please share – Rohit Gohel Sep 30 at 11:01
  • 1
    HI @RohitGohel Yes, I have one link so It's easy to understand for what you want. blog.plazathemes.com/archives/2340 – MOHIT Sep 30 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.