Tribe__Tickets_Plus__Commerce__WooCommerce__Email::trigger( int $order_id )
The callback fired on the wootickets-send-tickets-email action.
Contents
Parameters
- $order_id
-
(int) (Required) The ID of the WooCommerce order whose tickets are being emailed.
Source
File: src/Tribe/Commerce/WooCommerce/Email.php
public function trigger( $order_id ) {
if ( $order_id ) {
$this->object = new WC_Order( $order_id );
$this->recipient = method_exists( $this->object, 'get_billing_email' )
? $this->object->get_billing_email() // WC 3.x
: $this->object->billing_email; // WC 2.x
}
if ( ! $this->is_enabled() || ! $this->get_recipient() ) {
return;
}
$sent = $this->send(
$this->get_recipient(),
$this->get_subject(),
$this->get_content(),
$this->get_headers(),
$this->get_attachments()
);
if ( $sent ) {
$this->maybe_add_order_note_for_manual_email( $order_id );
}
}