Jump to content

Shipped Order Email


Geoc112

Recommended Posts

Hello, i am using a custom php script that generates the tracking number for an order and changes the order status to Shipped. How can i also make to send the shipped themplate email like when i manually change the status to shipped for BO.

This is my code

	$objOrder = new Order($id_comanda);
	$history = new OrderHistory();
	$history->id_order = (int)$objOrder->id;
	$history->changeIdOrderState(4, (int)($objOrder->id));
	$history->id_employee = 3;
	$link->query("INSERT INTO ps_order_history (id_employee, id_order, id_order_state, date_add) VALUES ('3', '$id_comanda', '4', NOW());");

Coming back with an edit: I solved my problem by replacing the last line with $history->addWithemail(true);

Edited by Geoc112
Solved (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...