Automattic\WooCommerce\Admin\Features\Fulfillments

FulfillmentsManager::init_email_template_tracking_hooksprivateWC 1.0

Initialize hooks to track when fulfillment email templates are customized.

Hooks into the WooCommerce email settings save action for each fulfillment email type so we can track when merchants customize these templates.

Method of the class: FulfillmentsManager{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->init_email_template_tracking_hooks(): void;

FulfillmentsManager::init_email_template_tracking_hooks() code WC 10.9.4

private function init_email_template_tracking_hooks(): void {
	$fulfillment_email_ids = array(
		'customer_fulfillment_created',
		'customer_fulfillment_updated',
		'customer_fulfillment_deleted',
	);

	foreach ( $fulfillment_email_ids as $email_id ) {
		add_action(
			'woocommerce_update_options_email_' . $email_id,
			function () use ( $email_id ) {
				FulfillmentsTracker::track_fulfillment_email_template_customized( $email_id );
			}
		);
	}
}