With the following code, you can send any order email with the order ID, on any email adress. It’s usefull when you want to test and debug confirmation order emails

Create text.php file on your magento server root and add this code :  

<?php

require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'Mage.php');
Mage::app();
Mage::getSingleton('core/translate')->init('en_US', true);
Mage::app()->getTranslator()->init('frontend', true);
Mage::setIsDeveloperMode(true);

try{
    $orderId = 1063;
    $order = Mage::getModel('sales/order')->load($orderId);
    $order->setEmailSent(0);
    $order->setCustomerEmail('custom@mail.com');
    $order->sendNewOrderEmail();
    var_dump('ok');
} catch(Exception $e) {
    var_dump($e->__toString());
}

Change the orderId and choose the mail you want.
Don’t forget to remove the php file when your debug is finished.

Debug confirmation order email
Share on FacebookTweet about this on TwitterShare on Google+Email this to someone
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *

We use cookies to ensure that we give you the best experience on our website.
Ok