V
V
vadbobkov2019-01-08 23:52:14
WordPress
vadbobkov, 2019-01-08 23:52:14

How to make SMS-informing and E-mail in woocommerce?

Good evening. There is such a topic. You need SMS and E-mail informing when the client has made an order. I also have two custom meta data for the products "Seller's E-mail" and "Seller's Phone". When the client ordered the goods, the client should receive one message, and the seller another message. How can this be implemented?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Sklyarov, 2019-01-09
@0example

Attach your function to the new order creation hook and that's it:

add_action( 'woocommerce_new_order', 'create_invoice_for_wc_order',  1, 1  );
function create_invoice_for_wc_order( $order_id ) {
    $order = new WC_Order( $order_id );
    $items = $order->get_items();
    // etc...
}

thus you get the seller's e-mail, phone number and anything else. Next, send sms via api through some similar service .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question