Home › Forums › Ticket Products › Event Tickets Plus › Adding Event Date to New Order Email
- This topic has 10 replies, 4 voices, and was last updated 11 years, 4 months ago by
Brook.
-
AuthorPosts
-
October 22, 2014 at 1:38 pm #827668
christina
ParticipantNew order emails are sent to admins when an order is received. I would like to know if there is a way I can also include the “Event date” in this email. Is there something I can add to the woocommerce email template? Similar to this: [code]<?php _e( ‘Product’, ‘woocommerce’ ); ?>[/code]
October 22, 2014 at 10:45 pm #828694Brook
ParticipantHowdy again,
The answer is actually a theme override as well. If you override /tickets/email.php, you can include pretty much any eveny info you need by tapping into our API. tribe_get_start_date() will get you the event start date, and of course could add the end date as well. You might need to pass the event id though like so:
tribe_get_start_date($tickets['event_id'])Does that work for you? I am happy to answer API questions and such if you have any. Thanks for posting!
– Brook
October 23, 2014 at 11:51 am #830107christina
ParticipantThis is the email that will go to the ADMIN right? My client wants to be able to see the date when a new order is placed. Where is /tickets/email.php ? thanks
October 24, 2014 at 9:52 am #832736christina
ParticipantAny update on this?
October 24, 2014 at 11:01 am #832892Brook
ParticipantHowdy christina,
The /tickets/ folder is actually inside of the core plugin, so /the-events-calendar/tickets/. There is a little more detail in the themers guide on how to override this in the Tickets section, just in case you have some trouble there.
So there are three type of emails send out:
email.php – Is sent to the customer, and already includes the Event date. So, it not makes sense that this is not the one you wish to override.
attendees-email.php – Is sent out when an order is processed. This is a summary of all the attendees to date including the latest order that the admin processed. If you wish to include the event date somewhere in the body, this is possible using a theme override as outlined above, it is in the tickets folder.
tribe_get_start_date($event)will work.Admin-new-order.php – This is not part of our plugin, but it sounds like it is the file you might wish to modify. This is part of WooCommerce. You can access it’s settings and such by going to WP Admin > WooCommerce > Settings > Emails > New Order. Near the bottom it will assist you with overriding it. However, this is a generic email sent anytime a person makes a woocommerce product purchase. Adding event specific stuff to it is going to be a bit complicated because it is designed for all products, not just tickets. Is it possible that you could instead just rely on the attendees-email.php instead, which happens after the admin approves/processes a ticket order? Until that happens the customer has not truly finished purchasing a ticket, and things like the attendee list in the Ticket will be out of date, the payment will not be processed, etc. Info on processing can be found here: https://theeventscalendar.com/support/documentation/wootickets-new-user-primer/#purchasewoo
Please let me know if you have questions. Cheers!
– Brook
PS. Sorry about the 24hr response, I was only able to do one pass of responses yesterday and it was just before your question.
November 1, 2014 at 1:58 am #853828Roberto Petti
Participantdear Brook
this is a big problem for me. On my site I have an event that is repeated many times and when I get an order by e-mail I do not know what date it refers.
you can solve the problem?
thank you very much
RobertoNovember 3, 2014 at 3:52 pm #858687Brook
ParticipantHowdy operom and Christina,
I was thinking about this problem, when it occurred to me there might be an easier way to do it that would not require a WooCommerce email override. This snippet, which can be pasted in your theme’s functions.php file, will append the event start date to the title of tickets when they appear inside of order summaries (such as you would see in an email). Does that work for you? Paste it in your functions file, then see if new orders now contain the start date added to the end of the ticket title.
If that does not work for you operom, you might need to open a new topic. We strive hard to keep our topics confined to only one issue, that way it gets our full attention.
– Brook
November 3, 2014 at 11:56 pm #859291Roberto Petti
ParticipantWow! problem solved!
Thank you so much, they were several weeks I was looking for a solution !!
it remains only one point. In the confirmation email and also on the tickets sent to the client, the date appears with the year 2008 instead of 2014. Why not?
Sorry for my English … (I’m Italian)November 4, 2014 at 10:45 am #860302Brook
ParticipantHello again operom,
Your English is very easy to understand!
The problem is that for recurring events it will show the first event date in a series. This is because by the time an email is sent there is no longer any information identifying which recurrence of the event is being purchased. It is unfortunate. In the future our plugin will be using a unique “product ID” for each recurrence, or at least a “product variant”. At that time this snippet will either automatically being inserting the correct date for recurring events, or it will require a small change to work properly.
Until then, if you are interested in writing up a temporary solution such a thing could be done by creating a custom email template, tapping into the filter ‘woocommerce_email_order_items_table’ and overriding its with your unique template. Since you will have the Woo Order item, you will be able to glean the necessary info about the purchased event. This is not something that we can easily write a snippet for at this point. But, in the future once our updated ticketing framework which we are working on has been released then this will be something we can do a snippet for.
Does that snippet help you, Christina? Or, were you having issues with recurring events as well?
– Brook
December 3, 2014 at 9:57 am #906433tydennis
ParticipantThe snippet in this reply (Brook November 3, 2014 Permalink ) works but how can I change it to where it prints the selected date of the event. I have a recurring event setup but it show the date when the recurring event was setup which was November 25th. How can I set it to get the date of the event?
December 3, 2014 at 1:26 pm #906671Brook
ParticipantHowdy tydennis,
That is the problem I was referring to in the post above. You would need to create a custom theme override for the for WooCommerce emails template (emails/plain/email-order-items.php), not a theme override for our plugin. In said template you will have access to the WC_Abstract_Order and the products therein. From there you can run get the meta info for those products, including the events recurrence date. I hope that helps! It’s probably not the easiest modification to make. Though in the future, as I said, we plan to update our tickets framework and make a new snippet which does this for you.
I am going to archive this topic since it has gone for more than two weeks without a response from the original poster. We of course try to keep all of our topic focused on one issue and one customer, that way everyone gets our full attention. If you wish to continue this discussion tydennis you are more than welcome to, but please do so in a new topic. Cheers!
– Brook
-
AuthorPosts
- The topic ‘Adding Event Date to New Order Email’ is closed to new replies.
