We're working on importing orders from a legacy system into a Magento 18.104.22.168 store.
We have a script that creates the customer if he doesn't exist and creates the order.
We want to make sure that no emails get sent out from Magento for any of these orders.
We initially setup our script as such
<?php //Disable all emails Mage::app()->getConfig()->saveConfig('system/smtp/disable', '1', 'default', 0); //run import //Re-enable all emails Mage::app()->getConfig()->saveConfig('system/smtp/disable', '0', 'default', 0); ?>
We have two concerns with this approach
- If a customer places an order during the time that our script is running - they won't get a confirmation
- Since Magento now sends the emails through a queue and a cron, if our script is finished by time the cron runs, the emails will still get sent out.
What would be a better way to ensure that no emails get sent out as a result of our importing legacy orders?