Tribe__Tickets__RSVP::send_non_attendance_confirmation_legacy( int $order_id, int $event_id )
Dispatches a confirmation email that acknowledges the user has RSVP’d in cases where they have indicated that they will *not* be attending.
Contents
Parameters
- $order_id
-
(int) (Required) The order ID.
- $event_id
-
(int) (Required) The event ID.
Source
File: src/Tribe/RSVP.php
public function send_non_attendance_confirmation_legacy( $order_id, $event_id ) {
$attendees = $this->get_attendees_by_order_id( $order_id );
if ( empty( $attendees ) ) {
return;
}
// For now all ticket holders in an order share the same email.
$to = $attendees['0']['holder_email'];
if ( ! is_email( $to ) ) {
return;
}
/**
* Filters the non attending RSVP tickets email headers
*
* @since 4.5.2 added new parameters $event_id and $order_id
* @since 4.5.5 changed filter name to be unique to non attendance emails
*
* @param array email headers
* @param int $event_id
* @param int $order_id
*/
$headers = apply_filters( 'tribe_rsvp_non_attendance_email_headers', [ 'Content-type: text/html' ], $event_id, $order_id );
/**
* Filters the non attending RSVP tickets email attachments
*
* @since 4.5.2 added new parameters $event_id and $order_id
* @since 4.5.5 changed filter name to be unique to non attendance emails
*
* @param array attachments
* @param int $event_id
* @param int $order_id
*/
$attachments = apply_filters( 'tribe_rsvp_non_attendance_email_attachments', [], $event_id, $order_id );
/**
* Filters the non attending RSVP tickets email recipient.
*
* @since 4.5.2 added new parameters $event_id and $order_id
* @since 4.5.5 changed filter name to be unique to non attendance emails
*
* @param string $to
* @param int $event_id
* @param int $order_id
*/
$to = apply_filters( 'tribe_rsvp_non_attendance_email_recipient', $to, $event_id, $order_id );
/**
* Filters the non attending RSVP tickets email subject
*
* @since 4.5.2 added new parameters $event_id and $order_id
* @since 4.5.5 changed filter name to be unique to non attendance emails
*
* @param string
* @param int $event_id
* @param int $order_id
*/
$subject = apply_filters(
'tribe_rsvp_non_attendance_email_subject',
sprintf(
// Translators: %s: Event name.
__( 'You confirmed you will not be attending %s', 'event-tickets' ),
get_the_title( $event_id )
),
$event_id,
$order_id
);
$template_data = [
'event_id' => $event_id,
'order_id' => $order_id,
'attendees' => $attendees,
];
/**
* Filters the non attending RSVP tickets email content
*
* @since 4.5.2 added new parameters $event_id and $order_id
* @since 4.5.5 changed filter name to be unique to non attendance emails
*
* @param string email content
* @param int $event_id The event ID.
* @param int $order_id The order ID.
*/
$content = apply_filters( 'tribe_rsvp_non_attendance_email_content',
tribe_tickets_get_template_part( 'tickets/email-non-attendance', null, $template_data, false ),
$event_id,
$order_id
);
$sent = wp_mail( $to, $subject, $content, $headers, $attachments );
return $sent;
}
Changelog
| Version | Description |
|---|---|
| 5.5.10 | Introduced. |