Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active April 7, 2018 18:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cliffordp/13078d8bd9ba7879dacbdfaba81ea120 to your computer and use it in GitHub Desktop.
Save cliffordp/13078d8bd9ba7879dacbdfaba81ea120 to your computer and use it in GitHub Desktop.
The Events Calendar and Event Tickets: Add Event Link, Your Tickets link, Add to Calendar link to bottom of Tickets email -- https://cl.ly/1h0Z1t130i0T
<?php
/**
* The Events Calendar and Event Tickets: Add Event Link, Your Tickets link, Add to Calendar link to bottom of Tickets email
* Screenshot: https://cl.ly/1h0Z1t130i0T
*
* FYI: QR Code from Event Tickets Plus gets added at tribe_tickets_ticket_email_ticket_bottom at default priority
*
* From https://gist.github.com/cliffordp/13078d8bd9ba7879dacbdfaba81ea120
*/
add_action( 'tribe_tickets_ticket_email_ticket_bottom', 'cliff_ticket_email_links_event_ticket_ical', 50 );
function cliff_ticket_email_links_event_ticket_ical() {
$event_id = get_the_ID();
if ( ! function_exists( 'tribe_is_event' ) || ! tribe_is_event( $event_id ) ) {
return false;
}
// this HTML is based on that of adding the QR Code, from /wp-content/plugins/event-tickets-plus/src/Tribe/QR.php
?>
<table class="content" align="center" width="620" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" style="margin:15px auto 0; padding:0;">
<tr>
<td align="center" valign="top" class="wrapper" width="620">
<table class="inner-wrapper" border="0" cellpadding="0" cellspacing="0" width="620" bgcolor="#f7f7f7" style="margin:0 auto !important; width:620px; padding:0;">
<tr>
<td valign="top" class="ticket-content" align="left" border="0" cellpadding="20" cellspacing="0" style="padding:20px; background:#f7f7f7; width: 100%; text-align: center;">
<?php
printf( '<p>Full event details are available at %s.</p>
<p><a href="%s">View/Edit your reservation</a></p>
<p><a href="%s">Add event to your calendar</a></p>',
tribe_get_event_link( $event_id, true ),
tribe_get_event_link( $event_id ) . 'tickets/',
add_query_arg( 'ical', '1', tribe_get_event_link( $event_id ) )
);
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php
}
@ftfmedia
Copy link

ftfmedia commented Apr 7, 2018

So glad I found this.. only thing, is I'm not certain where to implement this snippet. I tried my functions and no luck. I tried the email page. No luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment