Page 1 of 1

Opencart 3.0.3.6 where is call for sending email on admin status change when notify is selected

Posted: Sat Apr 10, 2021 12:57 am
by sukhbirgs
Hello, i am trying to find the code block where call is made if admin selects notify on order status update.

Admin history update block calls : index.php?route=api/order/history
From here function history check for order info and calls
$this->model_checkout_order->addOrderHistory

function addOrderHistory updates order history, in this whole process json data is updated and returned back to calling page. Admin page will show message if success and status is updated. In this process i did not found any code block that calls mail order page for sending mail if notify is selected. But mail is being sent.
i want to find out the exact code that calls mail function if notify is selected. Can someone help me with this.
Thanks

Re: Opencart 3.0.3.6 where is call for sending email on admin status change when notify is selected

Posted: Sat Apr 10, 2021 1:47 am
by straightlight
You need to create an event for this. See documentation: https://github.com/opencart/opencart/wiki/Events-System

Re: Opencart 3.0.3.6 where is call for sending email on admin status change when notify is selected

Posted: Sat Apr 10, 2021 2:54 am
by sw!tch
The mail notify is controlled by an event on addOrderHistroy
https://github.com/opencart/opencart/bl ... /order.php

Trigger
catalog/model/checkout/order/addOrderHistory/before
Action
mail/order

You can view your events in the Admin -> Extensions -> Events and further read on what @straightlight linked for usage.