How do I trigger a email in Magento when an order is made?

£可爱£侵袭症+ 提交于 2020-01-02 08:32:35

问题


I need solution for the following: 1) Customer places order 2) Store owner recieves email WITHOUT price info (e.g. packing list)

What files do I need to edit (I've read lots of posts and they don't seem to mention the file paths).

Thx


回答1:


Two possible ways to achieve that:

  1. You can create a model rewrite for the class Mage_Sales_Model_Order and override the function Mage_Sales_Model_Order::sendNewOrderEmail by sending an email to the shop owner using a different template

  2. You can set the configuration entry "Sales Email/Order/Send Order Email Copy To" to nothing (so that the shop owner doesn't get the same email as the customer), and implement an observer catching the event sales_order_place_after. In the observer function you implement sending of an email to the shop owner using a template without the price info.




回答2:


I know I had a hack for it ... and then I don't have it anymore. I went through everything I could and right now, we're CCing ourselves the customer notification email. As soon as we're done with our site upgrade, I'll have to readd my hack. I'm pretty sure it's in app/core/Mage/Sales/Model/Order.php possibly in public function sendNewOrderEmail()

See this pic:

I remember hard coding in a file after the customer notification was sent, we sent another one to admin but hard coding the template ID for the transactional order notification email to 8. Now, somehow, I'm doing it the "right way" but have no idea how I'm triggering this transactional email to ALSO happen with the customer order notification.




回答3:


Make your custom module in that module just send a event after "sales_order_save_after". Catch this event in observer file and put your custum coding on observer. Read this



来源:https://stackoverflow.com/questions/14712407/how-do-i-trigger-a-email-in-magento-when-an-order-is-made

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!