cliffordp
4/20/2017 - 10:12 PM

Add single event iCal/.ics link to bottom of tickets email

Add single event iCal/.ics link to bottom of tickets email

<?php

/**
 * Add single event iCal/.ics link to bottom of tickets email
 *
 * From https://gist.github.com/cliffordp/f6b4669f2d1059f288d0583cc50a2944
 * Alternative if you want both Google Calendar link and iCal/.ics file link: https://gist.github.com/cliffordp/f9dfbb225d79fddd7154fa33ba25166a
 **/
add_action( 'tribe_tickets_ticket_email_ticket_bottom', 'cliff_ical_link_on_ticket_emails', 50 );
function cliff_ical_link_on_ticket_emails() {
    if( ! function_exists( 'tribe_get_single_ical_link' ) ) {
        return;
    }

	echo '<a class="tribe-events-ical tribe-events-button" href="' . esc_url( tribe_get_single_ical_link() ) . '" title="' . esc_attr__( 'Download .ics file', 'the-events-calendar' ) . '" >+ ' . esc_html__( 'iCal Export', 'the-events-calendar' ) . '</a>';
}