Change woocommerce email based upon email template
-
I’m attempting to use the woocommerce_email_before_order_table to add content to an email based upon
1) whether or not the “Order” is a quote. This part of my code appears to be working fine.
2) change the text depending upon whether the email is going to the customer or the administrator. That is what is NOT working.If the Order is a Quote,
- The Administrator email should say:
New Customer Quote. - The Customer email should say: Order Now – Please note your order will NOT be placed into our production until payment has been made’
With the code below, both the administrator and customer emails are displaying the customer email text. What am I doing wrong?
function add_order_email_instructionsNEW( $order, $sent_to_admin ) { // add_order_email_instructions if($sent_to_admin) { if ( $order->payment_method == 'jetpack_custom_gateway' ) { echo '<p style="font-size:2em; background-color:#08456e; color:white; padding:30px;">New Customer Quote</p>'; } else { echo 'New Customer Order'; } } elseif (!$sent_to_admin) { if ( $order->payment_method == 'jetpack_custom_gateway' ) { // quote echo '<p style="font-size:2em; background-color:#08456e; color:white; padding:30px;">Here is your quote <a style=" background-color:#e5d11e; padding:10px; font-size:.5em; text-decoration:none; font-weight:bold; margin-left:30px;" href="https://accessfixtures.com/my-account/">Order Now</a></p>'; echo '<p>Please note your order <strong>will NOT be placed into our production</strong> until payment has been made. </p>'; } else { // other methods (ie credit card) echo '<p style="font-size:2em; background-color:#08456e; color:white; padding:30px;">Thank you for Your Order</p>'; } } } // END d_order_email_instructions
- The Administrator email should say:
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Change woocommerce email based upon email template’ is closed to new replies.