Skip to content

Instantly share code, notes, and snippets.

@deivisonarthur
Created September 4, 2012 21:15
Show Gist options
  • Select an option

  • Save deivisonarthur/3626600 to your computer and use it in GitHub Desktop.

Select an option

Save deivisonarthur/3626600 to your computer and use it in GitHub Desktop.
<?php
//require_once MAGE_BASE_DIR . 'app/Mage.php';
$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
if ($order->getId()) {
try {
$order->sendNewOrderEmail();
echo "\n\nEnvio de email do pedido com sucesso!\n";
} catch (Exception $e) {
echo $e->getMessage();
}
} else {
echo "Pedido $orderId nao encontrado\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment