title: Changing WooCommerce e-mail recipient
body: <p>How can I override the existing functionality in WooCommerce e-mail classes in order to change the recipient of an e-mail in my theme?</p>
  
  <p>The class responsible for sending the e-mail I need to switch the recipient for is <code>WC_Email_Cancelled_Order</code>. Instead of sending it to a specified number of admin e-mails, I would like this to instead send the e-mail to the customer that the order has been cancelled.</p>
  
  <p>In <code>WC_Email_Cancelled_Order</code> I figure that in the constructor on line 42 it sets the recipient.</p>
  
  <p>Am I supposed to use the actions defined on line 35 and 36 in order to do this, instead? If so, how would I go about doing that?</p>
  
  <p>edit:</p>
  
  <p>I ended up doing the following in order to achieve what I'm trying to do</p>
  
  <pre><code>add_action( 'woocommerce_order_status_pending_to_cancelled_notification', 'hg_override_cancelled_email_recipient' );
  add_action( 'woocommerce_order_status_on-hold_to_cancelled_notification', 'hg_override_cancelled_email_recipient' );
  
  function hg_override_cancelled_email_recipient( $order_id ) {
      $cancelledEmail = new WC_Email_Cancelled_Order();
  
      if ( $order_id ) {
          $cancelledEmail-&gt;object                  = wc_get_order( $order_id );
          $cancelledEmail-&gt;find['order-date']      = '{order_date}';
          $cancelledEmail-&gt;find['order-number']    = '{order_number}';
          $cancelledEmail-&gt;replace['order-date']   = date_i18n( wc_date_format(), strtotime( $cancelledEmail-&gt;object-&gt;order_date ) );
          $cancelledEmail-&gt;replace['order-number'] = $cancelledEmail-&gt;object-&gt;get_order_number();
          $cancelledEmail-&gt;recipient               = $cancelledEmail-&gt;object-&gt;billing_email;
      }
  
      if ( ! $cancelledEmail-&gt;is_enabled() || ! $cancelledEmail-&gt;get_recipient() ) {
          return;
      }
  
      $cancelledEmail-&gt;send(
          $cancelledEmail-&gt;get_recipient(),
          $cancelledEmail-&gt;get_subject(),
          $cancelledEmail-&gt;get_content(),
          $cancelledEmail-&gt;get_headers(),
          $cancelledEmail-&gt;get_attachments()
      );
  }
  </code></pre>