How to add Event title into tickets email?

Home Forums Ticket Products Event Tickets Plus How to add Event title into tickets email?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1070248
    Karl
    Participant

    Hi, I see this has been asked before (https://theeventscalendar.com/support/forums/topic/display-event-data-event-title-into-email-order/) but wasn’t answered. What I’m trying to do is ensure that all tickets have the event title appended in all emails.

    Can anyone help?

    #1070498
    Geoff B.
    Member

    Good evening Karl and welcome back!

    Thank you for reaching out to us.
    We will gladly try to assist you on this topic.

    What I’m trying to do is ensure that all tickets have the event title appended in all emails.

    I actually do see an answer in the thread you referenced. Maybe there is something that I’m missing ?

    Your best bet is to use my colleague Brook’s great snippet and tweak it to replace the date by the event title.

    Let me know if that helps.

    Have a great day!

    Geoff B.

    #1070869
    Karl
    Participant

    Hi Geoff, I found that when I used that method, too many things were affected. I have limited the impact by modifying the php file and functions file, as below

    // Product name
    echo apply_filters( ‘woocommerce_order_item_name_customer_email’, $item[‘name’], $item, false );

    and

    add_filter( ‘woocommerce_order_item_name_customer_email’ , ‘woocommerce_email_item_name_event_title’, 10, 3 );

    function woocommerce_email_item_name_event_title( $title, $values, $cart_item_key ) {
    $ticket_meta = get_post_meta( $values[‘product_id’] );
    $event_id = absint( $ticket_meta[‘_tribe_wooticket_for_event’][0] );
    if ( $event_id ) {
    $title = sprintf( ‘%s for %s‘, $title, get_the_title( $event_id ) );
    }
    return $title;
    }

    but that still messes up one of the admin mails a little – I am still working on it.

    #1070963
    Geoff B.
    Member

    Good afternoon Karl,

    Thank you for sharing your tweak on the code. I’m sure other users will appreciate that.

    In fact, if you don’t mind, I would welcome you to paste your final version of the code here.
    As a side note, sharing code is usually much cleaner when using something like pastebin or gist 🙂

    Finally, although we officially don’t support customizations, if you are stuck with the code please feel free to expand on the issue you are encountering. I can’t promise you anything, but I’d be glad to take a stab at it.

    Have a great day!

    Geoff B.

    #1071503
    Karl
    Participant

    I’ve pretty much got there now. I also wanted to show the event name with ticket names in the orders admin pages – that proved to be quite a challenge but I’ve managed that with a variant of the above code. Once I’m past my deadlines I’ll paste some snippets.

    #1071820
    Geoff B.
    Member

    Awesome! Great job!

    Yes please, if you could do that, it would be fantastic.

    Good luck with the deadlines.

    Geoff B.

    #1082474
    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 7 posts - 1 through 7 (of 7 total)
  • The topic ‘How to add Event title into tickets email?’ is closed to new replies.