How can I send The new order Emails using:
$order->sendNewOrderEmail();
only from a cronjob used in My custom Module.
Thanks for help.
cronemailorders
How can I send The new order Emails using:
$order->sendNewOrderEmail();
only from a cronjob used in My custom Module.
Thanks for help.
Best Answer
I would disable
System > Configuration > Sales Email > Order > Enabled
this makes sure that during normal execution it is not send
Then in your custom module include something like
The main idea being to override the disabled configuration value at runtime. The code is not tested but should give you a starting point. Further recommended reading from Alan's blog: http://alanstorm.com/magento_loading_config_variables http://alanstorm.com/magento_config_a_critique_and_caching
One issue that you might encounter is a cached value for the above.
Second option would be to duplicate the code from sendNewOrderEmail().