Automattic\WooCommerce\Internal\EmailEditor\EmailTemplates

TemplateApiController::get_template_datapublicWC 1.0

Returns the sender settings for the given template.

Method of the class: TemplateApiController{}

No Hooks.

Returns

Array.

Usage

$TemplateApiController = new TemplateApiController();
$TemplateApiController->get_template_data( $template_data ): array;
$template_data(array) (required)
- WP_Block_Template data.

TemplateApiController::get_template_data() code WC 10.3.6

public function get_template_data( $template_data ): array {
	$template_slug = $template_data['slug'] ?? null;
	if ( WooEmailTemplate::TEMPLATE_SLUG !== $template_slug ) {
		return array();
	}

	return array(
		'sender_settings' => array(
			'from_name'    => get_option( 'woocommerce_email_from_name' ),
			'from_address' => get_option( 'woocommerce_email_from_address' ),
		),
	);
}