I have created a custom module in Magento which performs the whole process starting from selecting a product, registering the customer and checking out with that product. The code for the entire process is done through code in indexcontroller of this module. Everything is done alright but the email is not sent on new order placed. I thought Magento would automatically send emails on new order creation even if the process is done programmatically. But it doesn't. Can anyone tell me how can I hook into the default sales order emails and send mails when the order is placed through custom module?
I have been able to sent mail to the new customer getting creating from this line of code just after saving the customer:
$customer->sendNewAccountEmail();
Does anyone know if there is some code like this to send new order email as well? Any help is much appreciated.