'waiting' === $w->status ); $notified_ids = array(); foreach ( $entries as $entry ) { $sent = wp_mail( $entry->email, sprintf( /* translators: %s: value */ __( 'Tickets available — %s', 'seathive' ), $event->post_title ), $this->build_notify_email_body( $event, $entry ), array( 'Content-Type: text/html; charset=UTF-8' ) ); if ( $sent ) { $notified_ids[] = $entry->id; } } SEATT_DB::mark_waitlist_notified( $notified_ids ); wp_safe_redirect( add_query_arg( array( 'page' => 'seatt-waitlist', 'event_id' => $event_id, 'seatt_notified' => count( $notified_ids ) ), admin_url( 'admin.php' ) ) ); exit; } private function build_notify_email_body( $event, $entry ) { $booking_url = home_url( '/' ); // best-effort generic link — see the note in the rendered email below ob_start(); ?>
'seatt-waitlist', 'event_id' => $event_id ), admin_url( 'admin.php' ) ) ); exit; } public function render_page() { $events = get_posts( array( 'post_type' => 'seatt_event', 'numberposts' => -1 ) ); // 0 = "nothing picked yet" — matches Chart Builder's "select an // event first" screen, so this page doesn't silently default to // whichever event happens to be most recently created. $selected = isset( $_GET['event_id'] ) ? intval( $_GET['event_id'] ) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only: chooses what to display if ( ! $selected ) { ?> 'waiting' === $w->status ) ); ?>