How to add mail functionality after shipping rate form submitted

By default request for shipment rate has no email functionality. Thanks to the hook provided by the plugin we will be able to apply it easily.

Just copy and paste this code to your theme functions.php file.

function my_update_shipment_type( $shipment_id, $form_data ){
  // get the current shipment status
  $wpcargo_status = get_post_meta( $shipment_id, 'wpcargo_status', true );
  // Send email to customer using the wpcargo default function
  wpcargo_send_email_notificatio( $shipment_id, $wpcargo_status );
}
add_action( 'wpcsr_after_save_shipment', 'my_update_shipment_type', 11, 2 );
0
    0
    Your Cart
    Your cart is emptyReturn to Shop