• Resolved Juuso Turunen

    (@juusoturunen)


    Hi!

    My goal is when my customer make an order, then WC sends a custom email to recipient which is in order custom field.

    My current code is following:

    
    ...
    
    	add_filter('woocommerce_email_recipient_new_order', 'additional_email_checkout', 10, 2);
    
    	function additional_email_checkout($emails, $object){
    	$aditional_email = get_post_meta($object->id, 'vuokranantajan_sahkopostiosoite_field', true);
    	if($aditional_email){
    		$emails .= ','.$aditional_email;
    	}
    		return $emails;
    	}
    
    

    Problem is that wrong email are sent. I want to send a custom email, not a WooCommerce’s default admin new order email.

    (sorry for bad english)

Viewing 1 replies (of 1 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    The code that you have provided is to add additional recipients to the WooCommerce default email. So the mail content sent to that recipient will be default WooCommerce email content.

    If you would like to send new emails to them, then you can do this by adding custom PHP code.

    You can use the below filter:

    do_action( 'woocommerce_checkout_order_processed', $order_id, $posted_data, $order );

    Please note that you need to add custom code to the above hook.

    We hope this will help.

    Thank you!

Viewing 1 replies (of 1 total)
  • The topic ‘Custom WC email recipient’ is closed to new replies.