Home › Forums › Ticket Products › Event Tickets Plus › Change email subject with event title
- This topic has 4 replies, 3 voices, and was last updated 7 years, 2 months ago by Christopher.
-
AuthorPosts
-
February 27, 2017 at 5:56 am #1246174ChristopherParticipant
Hi,
I try to change the subject line for admin emails when tickets are sold with woocommerce.
At the moment I have the following:
add_filter('woocommerce_email_subject_new_order', 'change_admin_email_subject', 1, 2); function change_admin_email_subject( $subject, $order ) { global $woocommerce; $event_title = do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); $subject = sprintf( 'New Ticket sold for the event: ' . $event_title ); return $subject; }
This doesn’t work beacuse I don’t get $event_title filled.
Could you please help me here?
Many thanks in advance!February 28, 2017 at 9:36 pm #1247406Geoff B.MemberGood evening Christopher and welcome back!
Thank you for reaching out to us.
I would love to help you with this topic.Just to set expectations, as you might know, the scope of our support is mostly to get our customers started on the right track and to help them in case of issues.
We unfortunately do not provide complete support for customization.
With that in mind, I would recommend a couple of things (if you have not already):
- Check out my colleague George’s approach: https://theeventscalendar.com/support/forums/topic/tickets-email-change-subject/#post-1107154
- I would recommend checking out the following function: https://theeventscalendar.com/function/tribe_get_events_title/ more specifically, how it’s used in the context of our plugin. The reason I am bring this up is because the way your code is written, it does not attempt to get the event title.
Let me know how that goes.
Best regards,
Geoff B.March 2, 2017 at 2:48 am #1248237ChristopherParticipantHi Geoff,
Thanks for your reply and hints, I got it working by rethinking the way I catch the event details.
Best regards
ChristopherMarch 2, 2017 at 12:05 pm #1248551Geoff B.MemberGood afternoon Christopher,
I am super stoked that my tips helped you find a solution works for you.
Kudos on that!You are welcome back in our support forums any time 🙂
For now, I am going to close this thread.
Have a great week!
Geoff B.
-
AuthorPosts
- The topic ‘Change email subject with event title’ is closed to new replies.