title: Send a custom reminder email for WooCommerce On-Hold orders after two days
body: <p>My goal is to send an email to the customer containing custom text if the order status is on-hold and if the order creation time is 48 hours or more old.</p>
  
  <ol>
  <li>order is 48 hours old or more</li>
  <li>send email to customer</li>
  <li>ask customer to pay</li>
  <li>include a link to the order (to my account payment page)</li>
  </ol>
  
  <p>I'm trying to use the code from <a href="https://stackoverflow.com/questions/55792360/automatically-cancel-order-after-x-days-if-no-payment-in-woocommerce">an answer</a> to one of my previous questions about Automatically cancel order after X days if no payment in WooCommerce.</p>
  
  <p>I have lightly changes the code:</p>
  
  <pre><code>add_action( 'restrict_manage_posts', 'on_hold_payment_reminder' );
  function on_hold_payment_reminder() {
      global $pagenow, $post_type;
  
      if( 'shop_order' === $post_type &amp;&amp; 'edit.php' === $pagenow 
          &amp;&amp; get_option( 'unpaid_orders_daily_process' ) &lt; time() ) :
  
      $days_delay = 5;
  
      $one_day    = 24 * 60 * 60;
      $today      = strtotime( date('Y-m-d') );
  
      $unpaid_orders = (array) wc_get_orders( array(
          'limit'        =&gt; -1,
          'status'       =&gt; 'on-hold',
          'date_created' =&gt; '&lt;' . ( $today - ($days_delay * $one_day) ),
      ) );
  
      if ( sizeof($unpaid_orders) &gt; 0 ) {
          $reminder_text = __("Payment reminder email sent to customer $today.", "woocommerce");
  
          foreach ( $unpaid_orders as $order ) {
              // HERE I want the email to be sent instead  &lt;===  &lt;===  &lt;===  &lt;===  &lt;=== 
          }
      }
      update_option( 'unpaid_orders_daily_process', $today + $one_day );
  
      endif;
  }
  </code></pre>
  
  <p>This is the email part that I want to sync with the above (read the code comments):</p>
  
  <pre><code>add_action ('woocommerce_email_order_details', 'on_hold_payment_reminder', 5, 4);
  function on_hold_payment_reminder( $order, $sent_to_admin, $plain_text, $email ){
  
      if ( 'customer_on_hold_order' == $email-&gt;id ){
          $order_id = $order-&gt;get_id();
  
          echo "&lt;h2&gt;Do not forget about your order..&lt;/h2&gt;
          &lt;p&gt;CUSTOM MESSAGE HERE&lt;/p&gt;";
      }
  }
  </code></pre>
  
  <p>So how can I send an email notification reminder for "on-hold" orders with a custom text? </p>