Woocommerce: send email to admin when new order place (pending payment)


woocommerceMany people ask me about how to send email notification to admin when new order is placed. By default, woocommerce only send out email when order payment is completed. But… thanks to Woocommerce team, they provide a lot of hooks to ease developer’s work. So we utilize the hook to do what we want.

Below is the code sample to send email notification to admin when new order is placed:-

Advertisements

  • Open your functions.php
  • Copy and paste the code below at the end of the functions.php
  • Save the file and you may try to create a new order and check if you receive the email notification.

* woocommerce_new_order hook will not return u any items details thru $order->get_items();
** You might also want to try woocommerce_checkout_order_processed hook, to get all the items




Share this with your friends:-

Leave a Reply