|
8 | 8 | *
|
9 | 9 | * @package Mailtpl
|
10 | 10 | * @subpackage Mailtpl/admin
|
11 |
| - * @author Damian Logghe <info@timersys.com> |
| 11 | + * @author wpexperts |
12 | 12 | */
|
13 | 13 | class Mailtpl_Admin {
|
14 | 14 |
|
@@ -43,15 +43,133 @@ public function __construct( $plugin_name, $version ) {
|
43 | 43 | $this->version = $version;
|
44 | 44 |
|
45 | 45 | }
|
46 |
| - |
| 46 | + public function email_template() { |
| 47 | + $link = $this->get_customizer_link(); |
| 48 | + ?> |
| 49 | + <style> |
| 50 | + .emailtemplate .container{ |
| 51 | + display: flex; |
| 52 | + } |
| 53 | + .emailtemplate .col-md-6 .boxcustom { |
| 54 | + background-color: white; |
| 55 | + margin-right: 20px; |
| 56 | + padding: 10px; |
| 57 | + border-radius: 4px; |
| 58 | + border: solid #d1d1ff 1px; |
| 59 | + transition: box-shadow 0.6s ease-in-out; |
| 60 | + -webkit-box-shadow: 2px 3px 9px -2px rgb(126 126 126 / 75%); |
| 61 | + -moz-box-shadow: 2px 3px 9px -2px rgb(126 126 126 / 75%); |
| 62 | + box-shadow: 2px 3px 9px -2px rgb(126 126 126 / 75%); |
| 63 | + text-align: center; |
| 64 | + } |
| 65 | + .emailtemplate button { |
| 66 | + margin-top: 15px; |
| 67 | + width: 97%; |
| 68 | + height: 45px; |
| 69 | + margin-top: 15px; |
| 70 | + width: 97%; |
| 71 | + height: 45px; |
| 72 | + border-radius: 7px; |
| 73 | + color: white; |
| 74 | + font-weight: 600; |
| 75 | + font-size: 18px; |
| 76 | + transition: box-shadow 0.6s ease-in-out; |
| 77 | + -webkit-box-shadow: 7px 7px 4px -4px rgb(122 122 122 / 75%); |
| 78 | + -moz-box-shadow: 7px 7px 4px -4px rgb(122 122 122 / 75%); |
| 79 | + box-shadow: 7px 7px 4px -4px rgb(122 122 122 / 75%); |
| 80 | + } |
| 81 | + .emailtemplate button.wordpress-btn { |
| 82 | + background-color: #0073aa; |
| 83 | + border: solid #6c6c6c 1px; |
| 84 | + } |
| 85 | + .emailtemplate button.woocommerce-btn { |
| 86 | + background-color: #8053b4; |
| 87 | + border: solid #6c6c6c 1px; |
| 88 | + } |
| 89 | + .boxcustom img { |
| 90 | + max-width: 100%; |
| 91 | + } |
| 92 | + .emailtemplate h2 { |
| 93 | + text-align: center; |
| 94 | + font-weight: 300; |
| 95 | + font-size: 23px; |
| 96 | + line-height: 46px; |
| 97 | + margin-top: 0px; |
| 98 | + } |
| 99 | + .headdingemailtemplate { |
| 100 | + text-align: center; |
| 101 | + margin-top: -10px; |
| 102 | + margin-bottom: 8px; |
| 103 | + } |
| 104 | + .headdingemailtemplate img { |
| 105 | + vertical-align:middle; |
| 106 | + max-width: 78px; |
| 107 | + } |
| 108 | + .emailtemplate .col-md-6:hover .boxcustom { |
| 109 | + transition: box-shadow 0.6s ease-in-out; |
| 110 | + box-shadow: 5px 3px 13px 0px rgb(126 126 126 / 75%); |
| 111 | + } |
| 112 | + .emailtemplate .col-md-6:hover button { |
| 113 | + transition: box-shadow 0.6s ease-in-out; |
| 114 | + box-shadow: 6px 5px 7px -1px rgb(126 126 126 / 75%); |
| 115 | + } |
| 116 | + </style> |
| 117 | + |
| 118 | + <div class="wrap emailtemplate"> |
| 119 | + <div class="headdingemailtemplate"> |
| 120 | + <h1> |
| 121 | + <img src="<?php echo esc_attr( MAILTPL_WOOMAIL_URL . 'assets/images/icon-128x128.png' ) ?>"> |
| 122 | + Email Templates |
| 123 | + </h1> |
| 124 | + </div> |
| 125 | + <div class="container"> |
| 126 | + <div class="col-md-6"> |
| 127 | + <div class="boxcustom"> |
| 128 | + <img src="<?php echo esc_attr( MAILTPL_WOOMAIL_URL . 'assets/images/WooCommerce-wordpress-02.png' ) ?>"> |
| 129 | + <h2 style="border-bottom: solid #54b0d1 1px;">WordPress Email Templates</h2> |
| 130 | + <p>Live preview your WordPress emails.</p> |
| 131 | + <p>Customize emails to match your brand colors.</p> |
| 132 | + <p>Customize heading, subtitle, and body text.</p> |
| 133 | + <p>Design and send custom-built emails with WordPress Email Templates.</p> |
| 134 | + <p>Choose your template style, add a logo or some text, change colors, edit footer and start sending nice emails in WordPress.</p> |
| 135 | + </div> |
| 136 | + <a target="_blank" href="<?php echo $link; ?>"> |
| 137 | + <button class="wordpress-btn">Open WordPress Email Editor</button> |
| 138 | + </a> |
| 139 | + </div> |
| 140 | + <div class="col-md-6"> |
| 141 | + <div class="boxcustom"> |
| 142 | + <img src="<?php echo esc_attr( MAILTPL_WOOMAIL_URL . 'assets/images/WooCommerce-wordpress-01.png' ) ?>"> |
| 143 | + <h2 style="border-bottom: solid #7f54b3 1px;">WooCommerce Email Templates</h2> |
| 144 | + <p>Customize the default transactional emails.</p> |
| 145 | + <p>Live preview your WooCommerce emails.</p> |
| 146 | + <p>Export and import your plugin settings.</p> |
| 147 | + <p>Design and customize WooCommerce's default transactional email templates.</p> |
| 148 | + <p>Use WordPress's native customizer for visual edits and customize the text (including body text) in WooCommerce without editing code.</p> |
| 149 | + </div> |
| 150 | + <a target="_blank" href="customize.php?mailtpl-woomail-customize=1&url=<?php echo urlencode( add_query_arg( array( 'mailtpl-woomail-preview' => '1' ), home_url( '/' ) ) ); ?>" > |
| 151 | + <button class="woocommerce-btn">Open Woocommerce Email Editor</button> |
| 152 | + </a> |
| 153 | + </div> |
| 154 | + </div> |
| 155 | + </div> |
| 156 | + <?php |
| 157 | + } |
47 | 158 |
|
48 | 159 | /**
|
49 | 160 | * Create the wp-admin menu link
|
50 | 161 | */
|
51 |
| - public function add_menu_link() { |
52 |
| - $link = $this->get_customizer_link(); |
53 |
| - add_submenu_page( 'themes.php', 'Email Templates', 'Email Templates', apply_filters( 'mailtpl/roles', 'edit_theme_options'), $link , null ); |
54 |
| - |
| 162 | + public function add_menu_link() { |
| 163 | + |
| 164 | + add_menu_page( |
| 165 | + esc_html__( 'Email Templates', 'mailtpl-woocommerce-email-composer' ), |
| 166 | + esc_html__( 'Email Templates', 'mailtpl-woocommerce-email-composer' ), |
| 167 | + 'manage_woocommerce', |
| 168 | + 'email-Template', |
| 169 | + array( $this,'email_template' ), |
| 170 | + 'dashicons-email', |
| 171 | + 52 |
| 172 | + ); |
55 | 173 | }
|
56 | 174 | /**
|
57 | 175 | * If we are in our template strip everything out and leave it clean
|
@@ -142,7 +260,7 @@ public function wp_pointers() {
|
142 | 260 | wp_enqueue_style( 'wp-pointer' );
|
143 | 261 |
|
144 | 262 | // Add pointers script to queue. Add custom script.
|
145 |
| - wp_enqueue_script( 'mailtpl-pointer', MAILTPL_PLUGIN_URL . '/admin/js/mailtpl-pointer.js', array( 'wp-pointer' ) ); |
| 263 | + wp_enqueue_script( 'mailtpl-pointer', MAILTPL_WOOMAIL_URL . '/admin/js/mailtpl-pointer.js', array( 'wp-pointer' ) ); |
146 | 264 |
|
147 | 265 | // Add pointer options to script.
|
148 | 266 | wp_localize_script( 'mailtpl-pointer', 'mailtpl_pointer', $valid_pointers );
|
@@ -204,7 +322,7 @@ function woocommerce_integration( $WC_Emails ) {
|
204 | 322 | remove_filter( 'mailtpl/email_content', 'convert_chars' );
|
205 | 323 | remove_filter( 'mailtpl/email_content', 'wpautop' );
|
206 | 324 | remove_action('woocommerce_email_header', array($WC_Emails , 'email_header'));
|
207 |
| - remove_action('woocommerce_email_footer', array($WC_Emails , 'email_footer')); |
| 325 | + //remove_action('woocommerce_email_footer', array($WC_Emails , 'email_footer')); |
208 | 326 | }
|
209 | 327 |
|
210 | 328 |
|
|
0 commit comments