Skip to content

Instantly share code, notes, and snippets.

@Garconis
Last active August 31, 2022 07:10
Show Gist options
  • Save Garconis/2fdb1ff809617da06cde399095dc93ac to your computer and use it in GitHub Desktop.
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
<?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