Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails

WCTransactionalEmailPostsGenerator::initializepublicWC 1.0

Initialize the email template generator.

This function initializes the email template generator by loading the default templates and generating initial email templates if needed.

Method of the class: WCTransactionalEmailPostsGenerator{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WCTransactionalEmailPostsGenerator = new WCTransactionalEmailPostsGenerator();
$WCTransactionalEmailPostsGenerator->initialize();

WCTransactionalEmailPostsGenerator::initialize() code WC 10.3.6

public function initialize() {
	if ( Constants::get_constant( 'WC_VERSION' ) === get_transient( $this->transient_name ) ) {
		// if templates are already generated, we don't need to run this function again.
		return true;
	}

	$this->init_default_transactional_emails();
	$this->generate_initial_email_templates();
}