WC_Settings_Emails::previewing_new_templatespublicWC 1.0

Show a notice to the user when they are trying out the new email templates.

Method of the class: WC_Settings_Emails{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WC_Settings_Emails = new WC_Settings_Emails();
$WC_Settings_Emails->previewing_new_templates(): void;

WC_Settings_Emails::previewing_new_templates() code WC 10.3.3

<?php
public function previewing_new_templates(): void {
	if ( ! $this->is_trying_new_templates() ) {
		return;
	}
	if ( FeaturesUtil::feature_is_enabled( 'email_improvements' ) ) {
		return;
	}
	update_option( 'woocommerce_admin_dismissed_try_email_improvements_modal', 'yes' );
	?>
	<div class="wc-settings-email-color-palette-header submit">
		<div class="notice notice-info inline">
			<p><?php esc_html_e( 'Previewing new template designs. You can customize and test your emails and switch to the new template whenever you are ready.', 'woocommerce' ); ?></p>
			<p>
				<button name="save" type="submit" class="components-button is-secondary" value="<?php esc_attr_e( 'Save changes', 'woocommerce' ); ?>">
					<?php esc_html_e( 'Switch to new template', 'woocommerce' ); ?>
				</button>
				<a href="?page=wc-settings&tab=email" class="components-button is-tertiary">
					<?php esc_html_e( 'Keep legacy template', 'woocommerce' ); ?>
				</a>
			</p>
		</div>
	</div>
	<?php
}