• Resolved decupe

    (@tlgozbey)


    Hello,

    Is it possible to send an email notification to our employee about orders from B2B members in WooCommerce’s new orders?

    We have an “employee” who is in charge of other wholesalers. This person is assigned the user role: admin.

    So, is there a way we can arrange for “our employee” to receive an email notification when the other wholesalers place their orders?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author WebWizards

    (@webwizardsdev)

    Hi there,

    If I understand correctly, you’d like for one of your staff to receive a copy of B2B new order emails?

    You can achieve this by adding this PHP code snippet to your site:

    add_filter( 'woocommerce_email_recipient_new_order', 'filter_new_order_email_recipient', 10, 2 );
    function filter_new_order_email_recipient( $recipient, $order ){
    
    
    	$b2b_email = '[email protected]';
    	
    	if (is_object($order)){
    		$customer_id = $order->get_customer_id();
    		$is_b2b = get_user_meta($customer_id, 'b2bking_b2buser', true);
    		if ($is_b2b === 'yes'){
    			// add another email
    			$recipient.= ', '.$b2b_email;
    		}
    	}		
    
        return $recipient;
    
    }

    You would change [email protected] with the email address you’d like to receive B2B orders.

    Thread Starter decupe

    (@tlgozbey)

    Thank you for your quick reply! I just want to send a copy of the new order mail notification from b2b members to my staff.

    Plugin Author WebWizards

    (@webwizardsdev)

    Great, I believe the above snippet should do that. Let me know if you can get that working,

    Thread Starter decupe

    (@tlgozbey)

    It works well! Your advice has been most helpful, thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘B2B orders send notification to another admin’ is closed to new replies.