Trigger hikashop to send "order status notification" email through a PHP script

  • Posts: 175
  • Thank you received: 0
8 years 8 months ago #253777

-- HikaShop version -- : 2.6.0

Hello

Is there a script to trigger the order status notification email? I want to create a script to automatically cancel order after certain period of time and send the "order status notification" email to notify both user and admin that order's status have changed

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 84043
  • Thank you received: 13619
  • MODERATOR
8 years 8 months ago #253797

Hi,

You can do it like that:

$order = new stdClass();
$order->order_id = $order_id;
$order->order_status = "cancel";
$order->history = new stdClass();
$order->history->history_notified = 1;
$orderClass = hikashop_get('class.order');
$orderClass->save($order);
That will change the status of the order and send a notification email to the customer.
If you want to receive a copy of the email, you can add your email address in the "BCC" field of the email when you edit it via the menu System>Emails.

The following user(s) said Thank You: veeco

Please Log in or Create an account to join the conversation.

Time to create page: 0.049 seconds
Powered by Kunena Forum
loading