Home › Forums › Ticket Products › Event Tickets Plus › Add event time and date to attendees list email
- This topic has 13 replies, 2 voices, and was last updated 5 years, 10 months ago by salilou.
-
AuthorPosts
-
April 3, 2018 at 3:55 am #1495061salilouParticipant
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!
April 3, 2018 at 9:32 am #1495423SkyKeymasterHello 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,
SkyApril 3, 2018 at 2:38 pm #1495819salilouParticipantHelp 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!April 4, 2018 at 9:24 am #1496430SkyKeymasterHannes,
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,
SkyApril 4, 2018 at 3:16 pm #1496933salilouParticipantThanks ou, but this extension is for the WooCommerce email, not for the attendees list email
April 5, 2018 at 8:51 am #1497480SkyKeymasterHannes,
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,
SkyApril 6, 2018 at 7:58 am #1498579salilouParticipantThank 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,
HannesApril 6, 2018 at 10:52 am #1498941SkyKeymasterHannes,
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
April 6, 2018 at 11:03 am #1498954salilouParticipantMeanwhile 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!
HannesApril 9, 2018 at 9:30 am #1500672SkyKeymasterHannes,
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,
SkyApril 15, 2018 at 1:00 pm #1507733salilouParticipantHello Sky,
yes please move this ticket to the “customization request queue”.
Thank you and greetings!
HannesApril 15, 2018 at 2:38 pm #1507764salilouParticipantHello 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!April 15, 2018 at 2:39 pm #1507769salilouParticipantResolved! 🙂
April 16, 2018 at 6:34 am #1508085SkyKeymasterHannes,
Awesome! I’m glad you figured it out.
Please let us know if you have any questions or issues in the future.
Take care,
SkyMay 8, 2018 at 9:35 am #1525387Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘Add event time and date to attendees list email’ is closed to new replies.