(1)I need to alter the new order email in woocommerce and need to see the preview . For to alter the content i create woocommerce/emails/admin-new-order.php inside theme folder enter image description here

.But when i preview the new order email , it didn't show my custom message or changes

enter image description here

why this is not working ? Could any one please tell .

(2)Hi is there is any hook available in woocommerce that for to send an email or do an action when customer place a order with any payment method, cash on delivery

  • ok .sorry for making trouble , but the only tag in the question is woocommerce , i didn't add any unappropriated tags like theming,loop,hook etc . – Ron Jan 25 '16 at 7:03

Are other theme overrides working or is this your first modification? I'm unsure as to if the preview takes into account your theme, but I assume the theme is installed and active as this looks like it should work.

As for the other question of a hook...

Woocommerce emails work based on triggers you call do_action on the specific email hook you want to fire out, if you look in wp-content\plugins\woocommerce\includes\emails\class-wc-email-new-order.php you can see 6 triggers for new order emails, do claling do_action on one of these and passing an order Id would emulate a new order email.

The easiest way however would be to make a new order through the front/bac end with your email, then view the order, in the top right corner of the page under Order actions choose to resend the email you want then click but button on the right of the drop down (Not obvious that this is the button most people click save order which is wrong). This way you don't have to make a page that fires a do_action trigger or anything. That and to do the do_action hook you need a order Id anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.