Q:

Change WooCommerce email recipient depending on address - Woocommerce Local Pick up Plus

I'm using Woocommerce Local Pick up Plus and want to change the email address depending on the order_shipping_method, but I can't get it work and I can't use var_dump to see whats happening     
 function wc_change_admin_new_order_email_recipient( $recipient, $order )   {
   global $woocommerce;

   $order = new WC_Order( $order->ID );

   if ( !  in_array( $order->get_shipping_method(), array( 'adress 1', 'adress 2', 'adress 3' ) ) ) {
     return $recipient = "myemail+nopickup@gmail.com";
   }else{

     if (in_array( $order->get_shipping_method(), 'adress 1' )) {
       $recipient = "myemail+adress1@gmail.com";
     }elseif (in_array( $order->get_shipping_method(), 'adress 2' )) {
       $recipient = "myemail+adress2@gmail.com";
     }elseif (in_array( $order->get_shipping_method(), 'adress 3' )) {
       $recipient = "myemail+adress3@gmail.com";
     }

     return $recipient;
   }

 }
 add_filter('woocommerce_email_recipient_new_order', 'wc_change_admin_new_order_email_recipient', 1, 2);

A:

Here's an example that uses a switch statement and matches the shipping method against a few of the available core shipping method IDs:
function wc_change_admin_new_order_email_recipient( $recipient, $order )   {

  $shipping_method = $order->get_shipping_method();

  switch( $shipping_method ){
    case 'local_pickup':
      $recipient = "myemail+local@gmail.com";
      break;
    case 'free_shipping':
      $recipient = "myemail+freeship@gmail.com";
      break;
    default:
      $recipient = "myemail+nopickup@gmail.com";
  }

  return $recipient;

}
add_filter('woocommerce_email_recipient_new_order', 'wc_change_admin_new_order_email_recipient', 1, 2);

