Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/woocomme.../src/Internal/Admin/Notes
File: EmailImprovements.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Adds a note when the email improvements feature is enabled for existing stores
[2] Fix | Delete
* or when the feature is not enabled to try the new templates.
[3] Fix | Delete
*
[4] Fix | Delete
* @since 9.9.0
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
declare( strict_types=1 );
[8] Fix | Delete
[9] Fix | Delete
namespace Automattic\WooCommerce\Internal\Admin\Notes;
[10] Fix | Delete
[11] Fix | Delete
defined( 'ABSPATH' ) || exit;
[12] Fix | Delete
[13] Fix | Delete
use Automattic\WooCommerce\Admin\Notes\Note;
[14] Fix | Delete
use Automattic\WooCommerce\Admin\Notes\NoteTraits;
[15] Fix | Delete
use Automattic\WooCommerce\Internal\Admin\EmailImprovements\EmailImprovements as EmailImprovementsFeature;
[16] Fix | Delete
/**
[17] Fix | Delete
* EmailImprovements
[18] Fix | Delete
*/
[19] Fix | Delete
class EmailImprovements {
[20] Fix | Delete
use NoteTraits;
[21] Fix | Delete
[22] Fix | Delete
/**
[23] Fix | Delete
* Name of the note for use in the database.
[24] Fix | Delete
*/
[25] Fix | Delete
const NOTE_NAME = 'wc-admin-email-improvements';
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* Get the note.
[29] Fix | Delete
*
[30] Fix | Delete
* @return Note|void
[31] Fix | Delete
*/
[32] Fix | Delete
public static function get_note() {
[33] Fix | Delete
if ( EmailImprovementsFeature::is_email_improvements_enabled_for_existing_stores() ) {
[34] Fix | Delete
return self::get_email_improvements_enabled_note();
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
if ( EmailImprovementsFeature::should_notify_merchant_about_email_improvements() ) {
[38] Fix | Delete
return self::get_try_email_improvements_note();
[39] Fix | Delete
}
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
/**
[43] Fix | Delete
* Get the note for when the email improvements feature is enabled for existing stores.
[44] Fix | Delete
*
[45] Fix | Delete
* @return Note
[46] Fix | Delete
*/
[47] Fix | Delete
private static function get_email_improvements_enabled_note() {
[48] Fix | Delete
$note = new Note();
[49] Fix | Delete
$note->set_title( __( 'Your store emails have had an upgrade!', 'woocommerce' ) );
[50] Fix | Delete
$note->set_content( __( 'We’ve made some exciting improvements to your email templates, including modern, shopper-friendly designs and new customization options. And if you’re using a block theme, you can automatically sync your theme styles! Head to your email settings to explore the new changes.', 'woocommerce' ) );
[51] Fix | Delete
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
[52] Fix | Delete
$note->set_name( self::NOTE_NAME );
[53] Fix | Delete
$note->set_source( 'woocommerce-admin' );
[54] Fix | Delete
$note->add_action(
[55] Fix | Delete
'customize-your-emails',
[56] Fix | Delete
__( 'Customize your emails', 'woocommerce' ),
[57] Fix | Delete
'?page=wc-settings&tab=email'
[58] Fix | Delete
);
[59] Fix | Delete
return $note;
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
/**
[63] Fix | Delete
* Get the note for when the email improvements feature is disabled.
[64] Fix | Delete
*
[65] Fix | Delete
* @return Note
[66] Fix | Delete
*/
[67] Fix | Delete
private static function get_try_email_improvements_note() {
[68] Fix | Delete
$note = new Note();
[69] Fix | Delete
$note->set_title( __( 'Store emails have had an upgrade!', 'woocommerce' ) );
[70] Fix | Delete
$note->set_content( __( 'We’ve made some exciting improvements to our email templates, including modern, shopper-friendly designs and new customization options. And if you’re using a block theme, you can automatically sync your theme styles! Head to your email settings to explore the new features.', 'woocommerce' ) );
[71] Fix | Delete
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
[72] Fix | Delete
$note->set_name( self::NOTE_NAME );
[73] Fix | Delete
$note->set_source( 'woocommerce-admin' );
[74] Fix | Delete
$note->add_action(
[75] Fix | Delete
'try-the-new-templates',
[76] Fix | Delete
__( 'Try the new templates', 'woocommerce' ),
[77] Fix | Delete
'?page=wc-settings&tab=email&try-new-templates'
[78] Fix | Delete
);
[79] Fix | Delete
return $note;
[80] Fix | Delete
}
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function