Dev Resources

  • Home
  • Reference
  • BuddyX Theme
  • Functions
  • Hooks
  • Classes
Filter by type:
Search
Browse: Home / Reference / Classes / WC_Email_Customer_Refunded_Order / WC_Email_Customer_Refunded_Order::trigger()

WC_Email_Customer_Refunded_Order::trigger( int $order_id, bool $partial_refund = false, int $refund_id = null )

Trigger.

Contents

  • Description
    • Parameters
    • Source
  • Related
    • Uses
    • Used By
  • User Contributed Notes

Description #Description


Parameters #Parameters

$order_id

(Required) Order ID.

$partial_refund

(Optional) Whether it is a partial refund or a full refund.

Default value: false

$refund_id

(Optional) Refund ID.

Default value: null


Top ↑

Source #Source

File: includes/emails/class-wc-email-customer-refunded-order.php

		public function trigger( $order_id, $partial_refund = false, $refund_id = null ) {
			$this->setup_locale();
			$this->partial_refund = $partial_refund;
			$this->id             = $this->partial_refund ? 'customer_partially_refunded_order' : 'customer_refunded_order';

			if ( $order_id ) {
				$this->object                         = wc_get_order( $order_id );
				$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 ( ! empty( $refund_id ) ) {
				$this->refund = wc_get_order( $refund_id );
			} else {
				$this->refund = false;
			}

			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();
		}

Expand full source code Collapse full source code


Top ↑

Related #Related

Top ↑

Uses #Uses

Uses
Uses Description
includes/emails/class-wc-email-customer-refunded-order.php: WC_Email_Customer_Refunded_Order::get_subject()

Get email subject.

includes/wc-formatting-functions.php: wc_format_datetime()

Format a date for output.

includes/wc-order-functions.php: wc_get_order()

Main function for returning orders, uses the WC_Order_Factory class.

Top ↑

Used By #Used By

Used By
Used By Description
includes/emails/class-wc-email-customer-refunded-order.php: WC_Email_Customer_Refunded_Order::trigger_partial()

Partial refund notification.

includes/emails/class-wc-email-customer-refunded-order.php: WC_Email_Customer_Refunded_Order::trigger_full()

Full refund notification.


Top ↑

User Contributed Notes #User Contributed Notes

You must log in before being able to contribute a note or feedback.

Proudly powered by WordPress