Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails

WCEmailTemplateSyncTracker::record_auto_appliedpublic staticWC 10.9.0

Record _update_applied for the auto-applier success path.

The auto-applier only runs against posts classified as core_updated_uncustomized, so had_customizations is statically false and auto_resolved is statically true. Documented at the call site rather than computed.

Method of the class: WCEmailTemplateSyncTracker{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = WCEmailTemplateSyncTracker::record_auto_applied( $post_id ): void;
$post_id(int) (required)
The woo_email post that was just rewritten with canonical core content.

Changelog

Since 10.9.0 Introduced.

WCEmailTemplateSyncTracker::record_auto_applied() code WC 10.9.1

public static function record_auto_applied( int $post_id ): void {
	if ( self::should_suppress() ) {
		return;
	}

	$payload = self::build_base_payload( $post_id );
	if ( null === $payload ) {
		return;
	}

	$payload['applied_from']       = self::APPLIED_FROM_AUTO;
	$payload['auto_resolved']      = true;
	$payload['had_customizations'] = false;

	self::record( self::EVENT_UPDATE_APPLIED, $payload );
}