wc_correios_trigger_tracking_code_email

Trigger tracking code email notification.

Description

wc_correios_trigger_tracking_code_email( (WC_Order) $order, (string) $tracking_code ); 

Parameters (2)

0. $order (WC_Order)
Order data.
1. $tracking_code (string)
The Correios tracking code.

Usage

  1. if ( !function_exists( 'wc_correios_trigger_tracking_code_email' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-correios/includes/wc-correios-functions.php'; 
  3.  
  4. // Order data. 
  5. $order = null; 
  6.  
  7. // The Correios tracking code. 
  8. $tracking_code = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wc_correios_trigger_tracking_code_email($order, $tracking_code); 
  12.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-correios-functions.php  
  1. function wc_correios_trigger_tracking_code_email( $order, $tracking_code ) { 
  2. $mailer = WC()->mailer(); 
  3. $notification = $mailer->emails['WC_Correios_Tracking_Email']; 
  4.  
  5. if ( 'yes' === $notification->enabled ) { 
  6. if ( method_exists( $order, 'get_id' ) ) { 
  7. $notification->trigger( $order->get_id(), $order, $tracking_code ); 
  8. } else { 
  9. $notification->trigger( $order->id, $order, $tracking_code );