WC_Email_Customer_Processing_Order

Customer Processing Order Email.

Defined (1)

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

/includes/emails/class-wc-email-customer-processing-order.php  
  1. class WC_Email_Customer_Processing_Order extends WC_Email { 
  2.  
  3. /** 
  4. * Constructor. 
  5. */ 
  6. public function __construct() { 
  7. $this->id = 'customer_processing_order'; 
  8. $this->customer_email = true; 
  9. $this->title = __( 'Processing order', 'woocommerce' ); 
  10. $this->description = __( 'This is an order notification sent to customers containing order details after payment.', 'woocommerce' ); 
  11. $this->heading = __( 'Thank you for your order', 'woocommerce' ); 
  12. $this->subject = __( 'Your {site_title} order receipt from {order_date}', 'woocommerce' ); 
  13. $this->template_html = 'emails/customer-processing-order.php'; 
  14. $this->template_plain = 'emails/plain/customer-processing-order.php'; 
  15.  
  16. // Triggers for this email 
  17. add_action( 'woocommerce_order_status_on-hold_to_processing_notification', array( $this, 'trigger' ), 10, 2 ); 
  18. add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'trigger' ), 10, 2 ); 
  19.  
  20. // Call parent constructor 
  21. parent::__construct(); 
  22.  
  23. /** 
  24. * Trigger the sending of this email. 
  25. * @param int $order_id The order ID. 
  26. * @param WC_Order $order Order object. 
  27. */ 
  28. public function trigger( $order_id, $order = false ) { 
  29. if ( $order_id && ! is_a( $order, 'WC_Order' ) ) { 
  30. $order = wc_get_order( $order_id ); 
  31.  
  32. if ( is_a( $order, 'WC_Order' ) ) { 
  33. $this->object = $order; 
  34. $this->recipient = $this->object->get_billing_email(); 
  35.  
  36. $this->find['order-date'] = '{order_date}'; 
  37. $this->find['order-number'] = '{order_number}'; 
  38.  
  39. $this->replace['order-date'] = wc_format_datetime( $this->object->get_date_created() ); 
  40. $this->replace['order-number'] = $this->object->get_order_number(); 
  41.  
  42. if ( ! $this->is_enabled() || ! $this->get_recipient() ) { 
  43. return; 
  44.  
  45. $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() ); 
  46.  
  47. /** 
  48. * Get content html. 
  49. * @access public 
  50. * @return string 
  51. */ 
  52. public function get_content_html() { 
  53. return wc_get_template_html( $this->template_html, array( 
  54. 'order' => $this->object,  
  55. 'email_heading' => $this->get_heading(),  
  56. 'sent_to_admin' => false,  
  57. 'plain_text' => false,  
  58. 'email' => $this,  
  59. ) ); 
  60.  
  61. /** 
  62. * Get content plain. 
  63. * @access public 
  64. * @return string 
  65. */ 
  66. public function get_content_plain() { 
  67. return wc_get_template_html( $this->template_plain, array( 
  68. 'order' => $this->object,  
  69. 'email_heading' => $this->get_heading(),  
  70. 'sent_to_admin' => false,  
  71. 'plain_text' => true,  
  72. 'email' => $this,  
  73. ) );