Tribe__Tickets__RSVP::maybe_send_tickets_after_status_change( int $event_id )

Triggers the sending of ticket emails after RSVP information is updated.

This is useful if a user initially suggests they will not be attending an event (in which case we do not send tickets out) but where they incrementally amend the status of one or more of those tickets to attending, at which point we should send tickets out for any of those newly attending persons.


Parameters

$event_id

(int) (Required) The event ID.


Top ↑

Source

File: src/Tribe/RSVP.php

	public function maybe_send_tickets_after_status_change( $event_id ) {
		$transaction_ids = array();

		foreach ( $this->get_event_attendees( $event_id ) as $attendee ) {
			$transaction = get_post_meta( $attendee['attendee_id'], $this->order_key, true );

			if ( ! empty( $transaction ) ) {
				$transaction_ids[ $transaction ] = $transaction;
			}
		}

		foreach ( $transaction_ids as $transaction ) {
			// This method takes care of intelligently sending out emails only when
			// required, for attendees that have not yet received their tickets
			$this->send_tickets_email( $transaction, $event_id );
		}
	}