Add event time and date to attendees list email

Home Forums Ticket Products Event Tickets Plus Add event time and date to attendees list email

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1495061
    salilou
    Participant

    Hi,

    if I manually email the attendees list to a specific email address, then there is the title of the event within the email, but no time and date of the event, which is somehow incomprehensible.

    Is there a hook to fix this?

    Thank you!

    #1495423
    Sky
    Keymaster

    Hello Hannes,

    There is a template for this email that can be copied into your theme and customized. The template is located in the Events Tickets plugin in src/views/tickets/attendees-email.php. You would copy this into [your-theme]/tribe-events/tickets/attendees-email.php and make your modifications.

    To get you pointed in the right direction, in this template you can use the $event variable, which stores the event as a WordPress post object. So, to get the event id, use $event->ID. You can then pass this into any tribe functions to get details of the event. For example, you might use tribe_get_start_date to get the event date and time like so:


    echo tribe_get_start_date( $event->ID, true );

    Let me know if that helps, or if you have any other questions.

    Thanks,
    Sky

    #1495819
    salilou
    Participant

    Help Sky,
    thank you for your hint, it did the trick!
    Is it possible to add two new fields to the list:
    • Phone number of attendee
    • Payment method of attendee
    I hope it is that easy too.
    Thank you!

    #1496430
    Sky
    Keymaster

    Hannes,

    I just found this extension that looks like it may enable the attendee fields to appear in the emails for tickets?

    Can you give that a look and see if it meets your needs?

    Thanks,
    Sky

    #1496933
    salilou
    Participant

    Thanks ou, but this extension is for the WooCommerce email, not for the attendees list email

    #1497480
    Sky
    Keymaster

    Hannes,

    Yes, you are correct. I misinterpreted the description for that extension.

    I’ve been looking through the code trying to find all the pieces that you would need to access that information, but I’m not coming up with everything.

    Here is an example of extracting the attendee data:

    // TEC ticket meta fields - get data
    $fieldset_meta = get_post_meta( $order->id, Tribe__Tickets_Plus__Meta::META_KEY, true );

    //If No fields set, do not process
    if (! $fieldset_meta ) return;

    //If fields set, loop and display each tickets data
    for($i = 0; $i < count($fieldset_meta); $i++) {
    $att_ticket_title = get_the_title($keys[$i]);
    echo '

    '. $att_ticket_title .'

    ';
    foreach( $fieldset_meta[$keys[$i]] AS $key => $value ) {
    $att_fname = (isset( $value['first-name'] )) ? $value['first-name'] : '';
    $att_lname = (isset( $value['last-name'] )) ? $value['last-name'] : '';
    $att_email = (isset( $value['email'] )) ? $value['email'] : 'this';
    $att_phone = (isset( $value['phone'] )) ? $value['phone'] : '';
    $att_profession = (isset( $value['profession'] )) ? $value['profession'] : '';
    $att_license = (isset( $value['license'] )) ? $value['license'] : '';
    echo '

    ';
    echo 'Attendee - '. ($key + 1) .'<br />';
    echo 'Name: '. $att_fname .' '. $att_lname .'<br />';
    echo 'Email: '. $att_email .'<br />';
    echo 'Phone: '. $att_phone .'<br />';
    echo 'Profession: '. $att_profession .'<br />';
    echo 'License #: '. $att_license .'<br />';
    echo '

    ';
    } //end foreach
    } //end for

    What I’m not sure about in the above example is how to access the order id which in there is “$order->id”;

    You can look at event-tickets/src/Tribe/Attendees.php at the generate_filtered_list() function. This is what defines the $items that are being looped through in the attendees-email.php file. There are some filters inside that function that could possibly be manipulated to add the data, and there may also be a way to get the id of the ticket for using in the above example.

    I’m sorry I don’t have a more complete answer for you. If you are unable to figure it out from the information I have provided, but still want to pursue this, I can add this ticket to our “customization request queue” and someone may be able to help. However, no guarantees if or when that would happen. Let me know if you’d like to go this route.

    Let me know if that helps!

    Thanks,
    Sky

    #1498579
    salilou
    Participant

    Thank you Sky.
    Outputting the payment method seems to be difficult without order id.
    Is there a way to output it not inly on the attendee list but also on the ticket email (email.php)?
    Greetings,
    Hannes

    #1498941
    Sky
    Keymaster

    Hannes,

    I have asked around about how to do this, but have not heard anything back yet.

    I will follow up on this next monday, and let you know if I’m able to find anything that may be helpful to you.

    Thanks for your patience, and have a good weekend!

    Sky

    #1498954
    salilou
    Participant

    Meanwhile I have made to output the payment method on the ticket email.
    My solution:
    // get order and payment method
    $ticket_order = wc_get_order( $ticket[‘order_id’] );
    $ticket_payment_method = $ticket_order->payment_method_title;
    Because order_id is there, it is easy.

    Now my only challenge is to output the payment method on the attendee list email (attendees-email.php).
    It would be cool if you could give me the information where it is called and the $items array is built.

    Thank you and have a nice weekend!
    Hannes

    #1500672
    Sky
    Keymaster

    Hannes,

    I’m glad you made some progress! I asked around, and was only told that it may be in stored in $item[6]? I have not confirmed this however.

    To pursue this any further, we will need to move this ticket to the “customization request queue” where someone may be able to help you find what you need. This level of customization is a bit beyond our scope of support, but someone may be able to assist if possible.

    Let me know if you’d like to go this route, or if the information I provided above helped answer your question.

    Thanks,
    Sky

    #1507733
    salilou
    Participant

    Hello Sky,
    yes please move this ticket to the “customization request queue”.
    Thank you and greetings!
    Hannes

    #1507764
    salilou
    Participant

    Hello Sky,
    I checked the generate_filtered_list() function and found that the items array has a field with order id.
    Now everything is easy.
    You can take my request back from customization queue.
    Thank you!
    Awesome support!

    #1507769
    salilou
    Participant

    Resolved! 🙂

    #1508085
    Sky
    Keymaster

    Hannes,

    Awesome! I’m glad you figured it out.

    Please let us know if you have any questions or issues in the future.

    Take care,
    Sky

    #1525387
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘Add event time and date to attendees list email’ is closed to new replies.