• Hey all,

    I am creating a website which lets users create a product ‘tickets’ for an event through a form, so they become the authors of this product automatically. I would like to make it so that when a customer buys a product, an email gets sent to the variable, $product_author.

    I tried using some filters I found to add recipients to a notification, but they were only for static emails. How do I do this if the recipient is dynamic?

    Thanks

    https://www.ads-software.com/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • The hook for completion is:

    add_action( 'woocommerce_order_status_completed', 'my_custom_function' );

    Then you need to get the order and then loop through the items in order.

    function my_custom_function( $order_id ) {
    
    	global $woocommerce;
    
    	$order = new WC_Order( $order_id);
    
    // do your staff here
    
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Send Email to Product Author on Order Completion’ is closed to new replies.