Change email subject with event title

Home Forums Ticket Products Event Tickets Plus Change email subject with event title

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1246174
    Christopher
    Participant

    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!

    #1247406
    Geoff B.
    Member

    Good 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):

    1. Check out my colleague George’s approach: https://theeventscalendar.com/support/forums/topic/tickets-email-change-subject/#post-1107154
    2. 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.

    #1248237
    Christopher
    Participant

    Hi Geoff,

    Thanks for your reply and hints, I got it working by rethinking the way I catch the event details.

    Best regards
    Christopher

    #1248551
    Geoff B.
    Member

    Good 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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Change email subject with event title’ is closed to new replies.