Remove "you'll receive your tickets in another email" from only some emails

Home › Forums › Ticket Products › Event Tickets Plus › Remove "you'll receive your tickets in another email" from only some emails

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1140613
    Timothy
    Participant

    Hey there,

    I’ve just noticed that whenever I send an email to my customer, they all have “you’ll receive your tickets in another email” at the bottom. This included emails for cancelled orders or refunded orders. I’ve found a solution in the support forums showing how to remove this from all emails (e.g. https://theeventscalendar.com/support/forums/topic/remove-the-youll-receive-your-tickets-in-another-email/) and that works great for that when I test it!

    However i would like to keep this phrase on the bottom of the completed order emails. Is there any way of selectively doing this?

    Thanks,

    Tim

    #1141216
    Nico
    Member

    Hi there Tim,

    Thanks for reaching out! Interesting question, let’s see how to do this…

    Paste the following snippet in your theme (or child theme) functions.php file:

    /* Tribe, only add "you'll receive your tickets in another email" message for given order statuses */
    if ( class_exists('Tribe__Tickets_Plus__Commerce__WooCommerce__Main') ) {

    // unhook default msg function
    $tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
    remove_action( 'woocommerce_email_after_order_table', array( $tickets, 'add_tickets_msg_to_email' ), 10 );

    // hook a custom action to check for order status before printing any msg
    add_action( 'woocommerce_email_after_order_table', 'maybe_add_tickets_msg_to_email' );

    function maybe_add_tickets_msg_to_email ( $order ) {

    $status = $order->post_status;

    // sample status check: bail if the status is not processing
    if ( $status != 'wc-processing' ) return;

    $tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
    $tickets->add_tickets_msg_to_email( $order );
    }
    }

    That should do the trick for you, be sure to change the status check for whatever fits your project!

    Best,
    Nico

    #1149514
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Remove "you'll receive your tickets in another email" from only some emails’ is closed to new replies.