Support » Plugin: Kadence WooCommerce Email Designer » Add additional meta placeholder in customer completed email

  • I’ve been trying to get an additional field that shows whether someone chose to attend an event online OR in-person, onto our customer completed orders because our registrars are getting emails asking to confirm their choices. I figure a placeholder would be the easiest way to accomplish this. I tried editing the email template and putting it into my child theme to no avail.

    I found this and changed it to the second one pasted in. Ben wrote this 2 years ago:

    add_filter( 'kadence_woomail_order_body_text', 'custom_function_for_billing_email', 10, 2 );
    function custom_function_for_billing_email( $text, $order ) {
    if ( is_a( $order, 'WC_Order' ) ) {
    $text = str_replace( '{billing_email}',  $order->get_billing_email(), $text );
    }
    return $text;
    }

    Here’s my feeble attempt. I really don’t know what I’m supposed to do here, so I would love some advice:

    add_filter( 'kadence_woomail_order_body_text', ‘customer_email_hybrid_venue, 10, 2 );   — registering the function here
    function customer_email_hybrid_venue( $text, $order ) {
    if ( is_a( $order, 'WC_Order' ) ) {
    $text = str_replace( ‘{customer_completed_order_email}',  $order->get_additional_wooccm0(), $text );
    }
    return $text;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • hannah

    (@hannahritner)

    Hi,
    Thanks for reaching out! I’ll have someone on our dev team determine the right code for you. Thanks for your patience!

    Kindly,
    Hannah

    Hi,

    Adding a placeholdder means you would edit the body text in your confirmation emails and add in the placholder, like {ticket_type}

    Then you would add the function to converted {ticket_type} into the text string for their ticket type.

    This requires that you have a way to get the text string for the ticket type from the order object.

    You are currently using:

    
    $order->get_additional_wooccm0()

    But that doesn’t look like anything real.

    My guess is that you would be better offer not trying to code this yourself instead working with the plugin that is creating the ticket option and from that angle hooking in the ticket type into the confirmation email using one of the many woocommerce email hooks.

    Ben

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.