Adding event fields (e.g. description) to email template

Home Forums Ticket Products Event Tickets Plus Adding event fields (e.g. description) to email template

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1116330
    TEME
    Participant

    We would like to edit the email template and add relevant content from the event page (e.g. its description).

    However, we cannot find a list of php shortcodes to acquire the information we need.

    Can you help us out?

    Regards,

    Teme

    #1116398
    Geoff
    Member

    Hello Teme, nice to see you again!

    You can customize the email template for tickets using a template override. There’s more on this in our Themer’s Guide, but it basically boils down to this:

    • Make a copy of the email.php template. It is located at /wp-content/plugins/event-tickets/src/views/tickets/email.php.
    • Make a new folder in your theme directory called tribe-events
    • Make a new folder in that one called tickets
    • Drop your copied email.php file in that last folder

    Now that the template is in your theme, you can customize it to suit your needs. In this case, you can use any of the functions noted here in our documentation to fetch and display event information in the email.

    Will this help you get started? Please let me know. 🙂

    Cheers,
    Geoff

    #1116879
    TEME
    Participant

    Hi Geoff,

    I have succeeded with creating a themed version of the email.php file.

    However, I have problems including the description as a field in the email. E.g. according to your help information I should be able to use
    $description = tribe_display_current_single_event_slug ( $event->ID );
    to include the description. However this creates a fatal error
    Fatal error: Call to undefined function tribe_display_current_single_event_slug().

    Please help me.

    Regards,

    Teme

    #1116956
    Geoff
    Member

    Hi Teme,

    I think what you’re looking for might be something like:

    <?php echo $event->post_description; ?>

    I haven’t tested this, but it looks like the code you had tried is attempting to pull a description from the current event’s slug.

    Cheers,
    Geoff

    #1117690
    TEME
    Participant

    The correct code is:
    <?php $html_postcontent = $event->post_content; $html_postexcerpt = $event->post_excerpt?>

    Regards,

    Teme

    #1117850
    Geoff
    Member

    Nice, thanks Teme!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Adding event fields (e.g. description) to email template’ is closed to new replies.