Extensions

Search Extensions

PDF Tickets

Event Tickets offers RSVP tickets, and Event Tickets Plus allows you to sell tickets via Easy Digital Downloads and/or WooCommerce.

When a customer buys one or more tickets, they receive an email confirmation with a copy of each attendee’s ticket, including the QR code and Attendee Additional Information if you have Event Tickets Plus.

Emailed PDFs

With this PDF Tickets extension activated, the email will include a PDF attachment of each attendee ticket. If your customer purchases 2 WooCommerce tickets in a single transaction, three emails will be sent:

  1. Your tickets from {site_name}
  2. Your {site_name} order receipt from {order_date}
  3. [{site_name}] New customer order ({order#}) – {order_date}

The first is from Event Tickets Plus and will include 2 separate PDF attachments, one per attendee. The second also goes to the customer but is the standard WooCommerce order confirmation email. The third is the notification that goes to the site administrator, not the customer.

This extension’s PDF attachments (one per attendee within the order) will be included in only the first Your tickets from {site_name} email. The last two emails do not have the PDF(s) attached.

wp-admin Attendees Report

With this extension active, the Attendees Report displays a “PDF Ticket” link for each attendee:

PDF ticket links as seen when viewing Attendees Report from the WordPress admin

Viewing PDFs

If you study the screenshot above, in the bottom-left corner, you will see the link to the PDF ticket: /tickets_download/5a25cf0ad099d153922935

All of this extension’s PDF files are stored in the top-level uploads directory (even if you have month- and year-based folders enabled in the Media settings), and the file names are in this format: tribe_tickets_{randomly_generated_string}.pdf

The {randomly_generated_string} part of the filename is stored in the WordPress database as a custom field in the attendee’s ticket.

Once this link is clicked, it will load the PDF file in the visitor’s browser, according to each browser’s default view settings:

Example PDF ticket as seen in the Google Chrome browser

You might wonder how a PDF file gets created if you have pre-existing orders at the time of activating this PDF Tickets extension. The extension has logic to auto-create the PDF on the fly, saving it to your Uploads directory and then loading the newly-created PDF in the browser, all without the user noticing that the PDF didn’t exist on the server in advance of their request.

Because of this on-the-fly functionality, you are able to delete some or all the tribe_tickets_….pdf files from your Uploads directory. For example, you might choose to do so after you have a large event conclude. Of course, we always recommend having restorable database and file backups before modifying anything on your site, manually or programmatically.

Note that PDF tickets exist on your file server but are not added to the WordPress Media Library. There is an action hook available if you would like to add custom code whenever a PDF is uploaded to the Uploads directory.

Regarding security and privacy: the PDFs on your server (or able to be created on-the-fly) are unprotected; they do not require authentication (being logged in as the applicable customer). While security through obscurity is not protective, we at least add a {randomly_generated_string} at the end of the filename to avoid ultra-simplistic file names. If you have concerns about unauthorized access to tickets, you could customize this extension’s code to your needs or choose not to use this extension at all.

If you need to support special characters: we have included mPDF’s bundled/default DejaVu font files (which support a wider range of characters) and, as of Version 1.1.0, you can implement this snippet to use this font instead of the system font:

Please read the snippet’s comments and reference Best Practices for Implementing Custom Code Snippets for how to implement custom code snippets.

Community Events Tickets Attendees Report

If you have our Community Events Tickets add-on, the Attendees Report exists on the front-end for each event, very similarly to the wp-admin Attendees Report, and also includes a link to each attendee’s PDF Ticket:

PDF ticket links as seen when viewing Attendees Report from Community Events

Changelog

  • Version 1.1.0
    • Released May 16, 2018
    • Feature – Added support for Tribe Commerce PayPal tickets
    • Feature – Added new public methods: delete_all_tickets_for_event(), delete_all_tickets_for_event(), delete_single_pdf_ticket()
    • Tweak – Delete PDF files from server whenever they are detected to be outdated, such as when the Event or one of its attached Venues or Organizers is updated or when an Attendee’s Additional Information is updated — added multiple hooks to disable deleting upon these triggers if you choose
    • Tweak – To be more extensible, made these methods public: ticket_link(), get_pdf_link(), get_direct_pdf_url(), get_pdf_path()
    • Tweak – Update mPDF library from version 7.0.0 to version 7.0.3
    • Tweak – Changed mPDF default arguments to default to letter-size (8.5 x 11 inches) instead of its default A4 (8.27 x 11.69 inches)
    • Tweak – Added new tribe_ext_pdf_tickets_mpdf_args filter to customize the arguments sent to mPDF
    • Fix – Protect against fatal error triggered when Event Tickets plugin got deactivated while this extension was still active
    • Fix – Add additional action hooks for when a ticket is modified and then force regenerating the PDF so it always matches the HTML/email version
    • Fix – WooCommerce – PDF email attachments now work according to your “When should attendee records be generated?” and “When should tickets be emailed to customers?” settings
    • Fix – WooCommerce – PDF email attachments now work when performing “Resend tickets email” from WooCommerce’s “Edit order” wp-admin screen
    • Fix – Corrected text domain, load text domain, and add a .pot file to make this extension plugin translatable
  • Version 1.0.0
    • Released December 6, 2017.
    • Requirements:
      • PHP version 5.6 or greater
      • Event Tickets version 4.5.2 or greater
      • (optional) Event Tickets Plus version 4.5.6 or greater
      • (optional) Community Events Tickets version 4.4.3 or greater
    • License is GPLv2 (not “GPLv2+”) to be compatible with mPDF’s “GPL-2.0-only” license in its composer.json file