0

I am currently using a code similar to what I need, from LoicTheAztec ( who should really be called "DaMan"). That code triggers Woo to send an email to a custom email address when order status is changed to "Processing". Without that code, a notification email only goes to the customer.

For my case I want to send a notification to both the customer, and the store owner. I was able to tweak previous code to do this - but the result was that both the customer and owner get the same email ( as in, they are both copied on exact same notice from Woo).

Here is what I am currently using in my functions.php:

// notify when order status set to processing
add_filter( 'woocommerce_email_recipient_customer_processing_order', 'processing_order_replacement_email_recipient', 10, 2 );
function processing_order_replacement_email_recipient( $recipient, $order ) {
    // Set HERE your replacement recipient email(s)… (If multiple, separate them by a coma)
    $recipient .= ',example@owneremail.com';
    return $recipient;
}

How could I trigger this so that the customer gets their copy, and the owner gets her copy separately? Also typically the stock emails generated by WOO have slightly different text versions between customer and store owner.

If what I am asking can't be done, I'll stick with what I have. Just wondering if there is a cleaner way to achieve it. Thanks in advance for any assistance!

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
Roy
  • 1
  • 2
  • 1
    I have no idea why you are reacting that way. All I ever did was compliment you and your assistance. After thorough testing, I found a problem. Reported the problem, and turned off "acceptance" because that is what I thought is supposed to be done with a code that isn't acting properly. Or else someone could use it and be disappointed correct? Seems you are taking something personal you should not be. Sorry if I didn't follow the strange protocol you were expecting - but then again this was my first post on stackoverflow. – Roy Feb 26 '18 at 23:11
  • The strange thing is that I thought I did write a comment regarding the problem. I don't see it here, so it was either removed or maybe it didn't save. I have found another solution so this code isn't necessary any longer. The problem I found after using this was that while the added trigger did result in email being sent to both store owner and customer, it also had the undesired effect of stopping some emails from being sent on all other status changes. I had two email addresses configured for the store owner and the 2nd was no longer receiving. Fixed as soon as I removed this code. – Roy Feb 28 '18 at 04:48

0 Answers0