简体   繁体   中英

Custom Woocommerce order email

I am using Woocommerce and the application has the following flow:

  1. Once the consumer has finished shopping, it is redirected to the standard checkout page.
  2. Then goes to the payment provider page where performs the payment.
  3. If the payment is successful - the user is redirected to the "Successful payment" page.
  4. The next step - sending REST API to the external provider and obtaining special Product ID. At this moment I need to add this special Product ID to the Woocommerce order email, but the email is already sent. So, is there a way to deal with this task, using some hook or something else?

you can use something like below:


add_action( 'woocommerce_email_order_details', 'email_custom', 5, 4 ); 
function email_custom( $order, $sent_to_admin, $plain_text, $email ) {
    
    // get product id from api...
    $product_id = '';
    
  echo '<p><strong>Product Id</strong>: '. $product_id .'</p>';
    
    
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM