Tribe__Tickets_Plus__Commerce__WooCommerce__Main::maybe_add_tickets_msg_to_email( string $heading, object $email = null )

Watches to see if the email being generated is a customer order email and sets up the addition of ticket-specific messaging if it is.


Parameters

$heading

(string) (Required)

$email

(object) (Optional)

Default value: null


Top ↑

Source

File: src/Tribe/Commerce/WooCommerce/Main.php

	public function maybe_add_tickets_msg_to_email( $heading, $email = null ) {
		// If the email object wasn't passed, go no further
		if ( null === $email ) {
			return;
		}

		// Do nothing unless this is a "customer_*" type email
		if ( ! isset( $email->id ) || 0 !== strpos( $email->id, 'customer_' ) ) {
			return;
		}

		// Do nothing if this is a refund notification
		if ( false !== strpos( $email->id, 'refunded' ) ) {
			return;
		}

		// Setup our tickets advisory message
		add_action( 'woocommerce_email_after_order_table', array( $this, 'add_tickets_msg_to_email' ), 10, 2 );
	}