I have a list of emails (dealers) and I need when I receive order in wp-admin i open this order and send this order to a dealer (commercial , user...). Every dealer have an email and mark this order in custom field that he have been send to this dealer.
In my woocommerce orders page I need to open a order and do something like this:
- Order 001 --- > send to Email1@exemple.com = Order 001 - Sent to Email1@exemple.com
- Order 002 ----> send to Email2@exemple.com = Order 002 - Sent to Email2@exemple.com
- Order 003 --- > send to Email1@exemple.com = Order 003 - Sent to Email1@exemple.com
I don't know where to start.
Does anyone have an idea or some code to achieve something like this?
Thanks
Here is a complete answer that will feet your needs. You will have to set in the 2nd function the array of the emails and names from your dealer list.
This code will display in backend Order edit pages a custom metabox with a selector, were you will set a dealer and you will click on "Save Order"…
A New Order notification email will be sent just once to that dealer email address.
Here is the code:
Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
This code is tested and works.