Send Emails After Order Placement in Magento 1.9

emailmagento-1.9orderspayment-methods

I want to have the following function in my store, I have two payments methods: CC and Bank Transfer Payment

  1. if the CC method was used, after the order was placed I need to send one email to the vendor company with product name and quantity. For vendor we can use a attribute that will contain email for each vendor in part.

    1. If Bank Transfer Payment was used, then we need to have a button in the back-end in order to can start the same action but manually.

How I can do something like this? Someone can point me in the correct direction?

Best Answer

I will not give you full code, But I will guide you step by step

Use this event in this event you will get all data related to order

sales_order_place_after

Here is the example of code how to use this event

Not triggering sales_order_place_after observer

Get order item from order and from order item load product and get supplier data from your product

you can use this thread for this

Get item from order id

you don't have to load $order you already have that in event.

Write code to send email here is the code how to write code to send email

How to send email using magento

Related Topic