WC_Settings_Emails::email_notification_setting_block_emailspublicWC 1.0

Creates the React mount point for listing of block based emails.

Method of the class: WC_Settings_Emails{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WC_Settings_Emails = new WC_Settings_Emails();
$WC_Settings_Emails->email_notification_setting_block_emails();

WC_Settings_Emails::email_notification_setting_block_emails() code WC 10.3.3

<?php
public function email_notification_setting_block_emails() {
	$desc_help_text = sprintf(
		/* translators: %1$s: Link to WP Mail Logging plugin, %2$s: Link to Email FAQ support page. */
		__( 'To ensure your store&rsquo;s notifications arrive in your and your customers&rsquo; inboxes, we recommend connecting your email address to your domain and setting up a dedicated SMTP server. If something doesn&rsquo;t seem to be sending correctly, install the <a href="%1$s">WP Mail Logging Plugin</a> or check the <a href="%2$s">Email FAQ page</a>.', 'woocommerce' ),
		'https://wordpress.org/plugins/wp-mail-logging/',
		'https://woocommerce.com/document/email-faq'
	);
	$email_post_manager   = WCTransactionalEmailPostsManager::get_instance();
	$emails               = WC()->mailer()->get_emails();
	$email_types          = array();
	$post_id_for_template = null;
	foreach ( $emails as $email_key => $email ) {
		$post_id       = $email_post_manager->get_email_template_post_id( $email->id );
		$email_types[] = array(
			'title'       => $email->get_title(),
			'description' => $email->get_description(),
			'id'          => $email->id,
			'email_key'   => strtolower( $email_key ),
			'post_id'     => $post_id,
			'enabled'     => $email->is_enabled(),
			'manual'      => $email->is_manual(),
			'recipients'  => array(
				'to'  => $email->is_customer_email() ? __( 'Customers', 'woocommerce' ) : $email->get_recipient(),
				'cc'  => $email->get_cc_recipient(),
				'bcc' => $email->get_bcc_recipient(),
			),
		);

		// Store the first valid post ID we find.
		if ( ! $post_id_for_template && $post_id ) {
			$post_id_for_template = $post_id;
		}
	}
	// Create URL for email editor template mode.
	$edit_template_url = null;
	if ( $post_id_for_template ) {
		$email_template_id = get_stylesheet() . '//' . WooEmailTemplate::TEMPLATE_SLUG;
		$edit_template_url = admin_url( 'post.php?post=' . $post_id_for_template . '&action=edit&template=' . $email_template_id );
	}

	?>
	<div
		id="wc_settings_email_listing_slotfill" class="wc-settings-prevent-change-event woocommerce-email-listing-listview"
		data-email-types="<?php echo esc_attr( wp_json_encode( $email_types ) ); ?>"
		data-edit-template-url="<?php echo esc_attr( $edit_template_url ); ?>"
	>
		<div style="
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 12px;
		height: 40px;
		width: 100%;
		">
			<h3> <?php esc_html_e( 'Loading&hellip;', 'woocommerce' ); ?>  </h3>
		</div>
	</div>
	<div>
		<p><?php echo wp_kses_post( wpautop( wptexturize( $desc_help_text ) ) ); ?></p>
	</div>
	<?php
}