cliff
9/26/2016 - 11:13 PM

Insert Page ID# 1572's content in top of Event Tickets / Event Tickts Plus email messages. Creates an easy-to-manage way to customize messag

Insert Page ID# 1572's content in top of Event Tickets / Event Tickts Plus email messages. Creates an easy-to-manage way to customize messaging using the WordPress Visual Editor instead of having to code HTML or keep up with any template override changes. Screenshot: https://cl.ly/103r1O0M0o32

<?php

/**
 * Insert Page ID# 1572's content in top of Event Tickets / Event Tickts Plus email messages
 * Creates an easy-to-manage way to customize messaging using the WordPress Visual Editor instead of having to code HTML or keep up with any template override changes.
 * Screenshot: https://cl.ly/103r1O0M0o32
 * 
 * !!! MUST CHANGE POST ID to your page's Post ID!!!
 * Recommended to leave this post unpublished (Draft or Pending Review)
 * Recommended to give it a descriptive post title so it doesn't get accidentally deleted or edited
 * Note: using post ID instead of getting page by slug (might be more user-friendly) because https://developer.wordpress.org/reference/functions/get_page_by_path/ returns FALSE for "private" pages/posts (and presumably Draft or Pending Review as well)
 *
 * Could use either `tribe_tickets_ticket_email_top` or `tribe_tickets_ticket_email_bottom` action or have 2 separate pages with different content.
 *
 * From https://gist.github.com/cliffordp/f35669e382c6dcb2088ad8161cd63289
 */
add_action( 'tribe_tickets_ticket_email_top', function() { // could use tribe_tickets_ticket_email_bottom instead
    echo get_post( 1572 )->post_content; // change to your Page ID
} );