WC_Email_Customer_Fulfillment_Updated::trigger
Trigger the sending of this email.
Method of the class: WC_Email_Customer_Fulfillment_Updated{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Email_Customer_Fulfillment_Updated = new WC_Email_Customer_Fulfillment_Updated(); $WC_Email_Customer_Fulfillment_Updated->trigger( $order_id, $fulfillment, $order, $customer_note );
- $order_id(int) (required)
- The order ID.
- $fulfillment(Fulfillment) (required)
- The fulfillment.
- $order(WC_Order|false)
- Order object.
Default:false - $customer_note(string)
- Customer note.
Default:''
WC_Email_Customer_Fulfillment_Updated::trigger() WC Email Customer Fulfillment Updated::trigger code WC 10.8.1
public function trigger( $order_id, $fulfillment, $order = false, $customer_note = '' ) {
$this->setup_locale();
if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
$order = wc_get_order( $order_id );
}
if ( is_a( $order, 'WC_Order' ) ) {
$this->object = $order;
$this->fulfillment = $fulfillment;
$this->customer_note = $customer_note;
$this->recipient = $this->object->get_billing_email();
$this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() );
$this->placeholders['{order_number}'] = $this->object->get_order_number();
}
if ( $this->is_enabled() && $this->get_recipient() ) {
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
}
$this->restore_locale();
}