Updated
The following code will add an additional recipient based on customer billing/shipping city, to new order admin notification:
add_filter( 'woocommerce_email_recipient_new_order', 'different_email_recipients', 10, 2 );
function different_email_recipients( $recipient, $order ) {
if ( ! is_a( $order, 'WC_Order' ) )
return $recipient;
$city = $order->get_shipping_city();
$city = empty( $city ) ? $order->get_billing_city() : $city;
// Conditionaly send additional email based on customer city
if ( 'Indore' == $city )
{
$recipient .= ',[email protected]';
}
elseif ( 'bhopal' == $city )
{
$recipient .= ',[email protected]';
}
return $recipient;
}
Code goes in function.php file of your active child theme (or active theme). Tested and works.
Related Posts:
- Woocommerce HTML email option unavailable
- Trigger Woocommerce New User Email
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- WooCommerce – Email admin with new user details
- Woocommerce Email attachments not working – file not being attached
- I want to fusion the product columns in email table order
- Woocommerce checkout page – custom field checkbox value into email
- Woocommerce custom field on emails outputs ‘Array’
- Why does WordPress not send the user the email to add a password?
- Trouble checking if custom woocommerce checkout field is empty or not
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- How to retrieve the sender email with wp_mail()?
- Validation algorithm in checkout field
- How do I remove the product thumbnail link from a specific div in Woocommerce? [closed]
- My new button is in the wrong place
- WordPress Woocommerce – Product Type [closed]
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- Pagination for custom shop loop woocommerce
- How to add specific meta tags to head of cart and checkout pages in woocommerce?
- How to remove woocommerce_breadcrumb() from do_action( ‘woocommerce_before_main_content’ ); [closed]
- Woocommerce change prices for a certain country [closed]
- How to get private property in parent class into extended class?
- Can I get an email notification when media is uploaded to the media library?
- echo something inside a shortcode
- Replace Woocommerce “add to cart” to be “Download” button [closed]
- Is there a way to hook or call a custom woocomerce template that is not part of the default templates of woocommerce?
- get taxonomy thumbnail and use it as a variable in code
- Function returns text instead of html [closed]
- Extend Woocommerce Widget Class – WC_Widget_Product_Categories
- Single Quotes in .php file doesn’t load website
- Add post with approval by the admin
- get_total () returns 0 – woocommerce [closed]
- How to remove coupon dropdown feature
- Woocommerce display one random product via php
- Change product_base programmatically
- Add html link in functions.php files of the theme
- require_once() if a product in woocommerce contains a tag [closed]
- How to optimize update_post_meta?
- How to upload WP user avatar on woocommerce account page [closed]
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- Remove item in Checkout
- email alert for product availability
- How to relocate paypal button gateway on checkout page in woocommerce
- How to rename woocommerce-billing-fields
- Can a plugin redirect product page based on IF condition?
- Seo Friendly Filter URLs
- How to display SQL query that ran in WC_Order_Query?
- WooCommerce pages looks unstyled
- customize woocommerce templates and display store on home
- How to disable delivery on certain date at checkout page in WooCommerce?
- WC_Customer delete function returns error
- Only show size attributes in product box woocommerce when available
- How do I change this function from two returns to one string to show sku and dimensions in WooCommerce cart?
- Remove page title in product page using a function
- woocommerce specific quantities for product
- how can i add class or span tag at sprintf?
- Call WC_Product get_price()?
- How to display a custom product field value of a specific category on a Woo Commerce checkout page?
- Personalize checkout text
- Display attribute on shop page after the title
- CSS change in woo commerce Place Order Text [closed]
- Woocommerce – get_items() returns empty array
- How do I run code every 24 hours?
- Get user custom field value on function.php
- Disable if there are no children – Woocommerce
- WooCommerce – Moving Product Price to the Left of Add to Cart Button [closed]
- Woocommerce Product_cat for current category page
- Exclude product attributes from taxonomy terms loop
- WP All Import / Update stock quantity from multiple XML files
- woocommerce related product title length
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- woocommerce wc_create_order(); is creating multiple orders instead of one?
- Create a package of products as one Item in woocommerce?
- Woocommerce: remove total sum from new order’s email [closed]
- Include js script ONLY on woocommerce product category pages? [closed]
- Pass return-path additional parameter in wp_mail
- WP_Query multiple post results
- Convert Featured products loop into Recent products loop?
- fetch woocommerce product with custom taxonomy
- difference between sanitize_email ,FILTER_VALIDATE_EMAIL and input email type in html5
- WordPress WP_Query without query GET parameters
- Where to copy woocommerce files to in my custom theme to avoid editing the core plugin?
- Alter Woocommerce product archive structure
- Have Woocommerce show product price if id, when not logged in
- After disabling WPML multi currency, the currency is still handled by the WPML
- custom post type with role Vendor
- How do i wrap woocomerce attribute in list?
- Removing files programmatically
- WooCommerce: Display product categories to make IF statement
- WordPress site with embedded menu – gives You don’t have permission to access /wp-content/themes/xxx/taxonomy-redirect.php on this server
- Woocommerce custom Plugin in wordpress [closed]
- WooCommerce “Checkout Now” button [closed]
- Custom Taxonomy Select Menu: Setting default option value?
- Use of antispambot with $curauth->email
- How do I attach an invoice PDF to an email in the Dukapress plugin for WordPress?
- How to separate product payment and shipping payment in WooCommerce checkout? [closed]
- How can i programmatically change the SKU of a product based on product variation?
- Execute PHP code only with specific user role
- Woocommerce Custom Meta Boxes- How to only display if they actually have content
- Add a custom WooCommerce settings tab with sections