Home › Forums › Ticket Products › Event Tickets Plus › How to add Event title into tickets email?
- This topic has 6 replies, 3 voices, and was last updated 10 years, 2 months ago by
Support Droid.
-
AuthorPosts
-
February 9, 2016 at 6:48 am #1070248
Karl
ParticipantHi, 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?
February 9, 2016 at 3:47 pm #1070498Geoff B.
MemberGood 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.
February 10, 2016 at 7:24 am #1070869Karl
ParticipantHi 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.
February 10, 2016 at 10:36 am #1070963Geoff B.
MemberGood 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.
February 11, 2016 at 6:38 am #1071503Karl
ParticipantI’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.
February 11, 2016 at 8:37 pm #1071820Geoff B.
MemberAwesome! Great job!
Yes please, if you could do that, it would be fantastic.
Good luck with the deadlines.
Geoff B.
February 26, 2016 at 8:35 am #1082474Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘How to add Event title into tickets email?’ is closed to new replies.
