You can achieve it without editing the WooCommerce templates using dedicated WooCommerce action hooks in 2 steps (if step 1 is not done yet):
Here is this functional and tested code:
# 1) Creating/Saving a custom field in the admin product pages general setting metabox.
// Inserting product general settings custom field (set the related video page ID)
add_action( 'woocommerce_product_options_general_product_data', 'product_general_settings_custom_field_create' );
function product_general_settings_custom_field_create() {
echo '<div class="options_group">';
woocommerce_wp_text_input( array(
'type' => 'text',
'id' => 'video_page_id', // we save the related page ID
'label' => __( 'Video page ID', 'woocommerce' ),
'placeholder' => '',
'description' => __( 'Insert page ID', 'woocommerce' ),
) );
echo '</div>';
}
// Saving the custom field value when submitted (saving the related video page ID)
add_action( 'woocommerce_process_product_meta', 'product_general_settings_custom_field_save' );
function product_general_settings_custom_field_save( $post_id ){
$wc_field = $_POST['video_page_id'];
if( !empty( $wc_field ) )
update_post_meta( $post_id, 'video_page_id', esc_attr( $wc_field ) );
}
# 2) Rendering the related video page link in your email "completed" order email notification.
// Displaying in completed order email notification the related video page permalink
add_action('woocommerce_order_item_meta_end', 'displaying_a_custom_link_in_completed_order_email_notification', 10, 4);
function displaying_a_custom_link_in_completed_order_email_notification($item_id, $item, $order, $html){
// For completed orders status only
if ( $order->has_status('completed') ){
// Get the custom field value for the order item
$page_id = get_post_meta( $item['product_id'], 'video_page_id', true);
$page_id = '324';
// Get the page Url (permalink)
$page_permalink = get_permalink( $page_id );
// Get the page title (optional)
$page_title = get_the_title( $page_id );
// Displaying the page link
echo '<br><small>' . __( 'Watch your video: ', 'woocommerce' ). '<a href="'.$page_permalink.'">' . $page_title . '</a></small>';
}
}
The Code goes in function.php file of your active child theme (or theme) or also in any plugin file.