You guys helped me pulling extra data into the order processing mail and it looks like this:
add_action( 'woocommerce_email_after_order_table', 'custom_add_content_specific_email', 20, 4 );
function custom_add_content_specific_email( $order, $sent_to_admin, $plain_text, $email ) {
if ( ($email->id == 'customer_on_hold_order') || ($email->id == 'new_order') ) {
// ID of the CT to get the content from
$target_ct = 1288;
ob_start();
// cycle through each product in the order
foreach ($order->get_items() as $item_id => $item_values) {
// get the product's ID
$product_id = $item_values['product_id'];
// get the related camp's ID
$related_camp_id = toolset_get_related_post( $product_id, 'camp-product' );
// get the content template's output with the related camp post set as the source
echo render_view_template( $target_ct, $related_camp_id );
}
echo ob_get_clean();
}
}
Is it possible to add some details like a title called "Praktisk info" above the data? And also change "Camp name" to "Camp navn"?
Thank you for contacting us and I'd be happy to assist.
That content in the email is coming from the content template named "Test CT to show camp details in email".
( yourwebsite.com/wp-admin/admin.php?page=ct-editor&ct_id=1288 )
You can change the text label for the existing fields or add a new one in there.