Last active
August 31, 2022 07:10
-
-
Save Garconis/2fdb1ff809617da06cde399095dc93ac to your computer and use it in GitHub Desktop.
WooCommerce | Add custom text above the Order Table in the Order Complete email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_email_before_order_table', 'add_content', 20, 4 ); | |
function add_content($order, $sent_to_admin, $plain_text, $email) { | |
// Adds to "completed order" email only | |
if ( $email->id == 'customer_completed_order' ) { | |
echo '<h2 id="h2thanks">Access Your Courses</h2><p id="pthanks">Thank you for making this purchase! You can now view your courses online by clicking <a href="https://courses.example.com/my-courses/" target="_blank">here</a>!</p>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment