When a customer purchases a ticket, various types of emails may be sent, including:
- Ticket Confirmation Email
- Completed Order Email
- Purchase Receipt
When using Tickets Commerce as the payment method, order emails and purchase receipts are handled by Tickets Commerce itself. Although email templates include placeholders, not all are available for every type of email. You can find more information about the different types of emails and the available placeholders for each one here.
Event Tickets Emails Knowledgebase
By default, the Completed Order email from Tickets Commerce includes a limited set of placeholders and does not provide built-in support for adding custom placeholders such as the purchaser’s name or event title. However, one can extend this functionality with custom coding. This article provides a snippet that enables the use of {purchaser_name} and {event_title} placeholders in the Completed Order email.
Adding Custom Placeholders to Completed Order Email
Add the following PHP code to the site to be able to use {event_title} and {purchaser_name} placeholders in the Completed Order email,
Add the code snippet to the functions.php file of your theme, or use your preferred method for integrating snippets into your WordPress site, such as the free Code Snippets plugin.
The snippet retrieves attendee information from the email object. It obtains the name of the individual who made the purchase, along with the associated event ID. Using this event ID, the title of the event is then retrieved. These details are then added to the available placeholders in the email.