Modify WooCommerce email shipping text value

FIXED IT

I was able to fix my function and it now works how intended. This is the working function and filter in case anyone wants to use. This will return custom text when flat rate shipping is free.

/* return custom text on email when shipping is free */
add_filter( 'woocommerce_order_shipping_to_display', 'filter_email_shipping_text', 10, 2 );

function filter_email_shipping_text( $shipping, $order_id ) {
  global $woocommerce, $post;
  $order = new WC_Order( $order_id );
  if ( $order->order_shipping == 0 ) {
    $shipping = sprintf(__( 'Free!', 'woocommerce' ));
  }
  return $shipping;
}