• Resolved jlanpheer

    (@jlanpheer)


    Hello, a request has come up from a client who is using your plugin that might involve some custom work, and i am seeking a bit of guidance on it. Essentially, when an order is completed, we’d like to be able to control which email address that the ‘cc’ email would go to.

    The scenario is relatively straightforward: The company has products of two different categories – let’s call them simply ‘Category A’ and ‘Category B’. If an order comes in where there are items on the order from ‘Category A’, the ‘cc’ email address that the company gets would be sent ‘Email Address A’. If the order comes in and has items from ‘Category B’, a different email address would receive the notification (‘Email Address B’). In the instance that an order comes in with products from BOTH categories, we’d like to have an email sent to EACH email address (two copies of the email, one to each address).

    Could you please advise (a) whether the above is possible via your plugin and (b) if so, could you point me to any resources or advice in how to configure WP for this requirement?

    Thank You!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Clayton R

    (@mrclayton)

    Hi @jlanpheer

    It is WooCommerce that controls the email logic when an order is processed, not the Stripe plugin. Any customizations you make would be made using the filters provided by WooCommerce.

    You can use the filter woocommerce_email_headers to determine which email is being sent and add the appropriate cc header.

    Example:

    add_filter('woocommerce_email_headers', function($headers, $id, $order){
    switch($id){
    case 'customer_completed_order';
    // logic to determine if order contains category A or B.
    $headers .= 'cc: ' . '[email protected]';
    break;
    }
    return $headers;
    }, 10, 3);

    Kind Regards

    Thread Starter jlanpheer

    (@jlanpheer)

    OK, thank you for your reply, much appreciated. I thought as much, but wanted to ensure we went the right path.

    Plugin Author Clayton R

    (@mrclayton)

    We always appreciate a good review of the plugin if you have a moment. https://ww.wp.xz.cn/support/plugin/woo-stripe-payment/reviews/

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Conditional Completed Order CC Email Configuration’ is closed to new replies.