WP Better Emails - Version 0.3

Version Description

  • Add proper multisite support: options are saved network wide
  • Remove strip_tags from message as it deletes password retrieve link from lost password email (see: https://wordpress.org/support/topic/password-reset-url-in-plain-version-password-reset-emails-not-showing?replies=3)
  • Improve from name and email, they are only set when default email is used
  • Fix help tab link
  • Add new filters to control converting line breaks to br tags and URls to links
Download this release

Release Info

Developer nlemoine
Plugin Icon 128x128 WP Better Emails
Version 0.3
Comparing to
See all releases

Code changes from version 0.2.8 to 0.3

Files changed (4) hide show
  1. js/wpbe-admin-script.js +1 -1
  2. readme.txt +27 -5
  3. wpbe-options.php +2 -2
  4. wpbe.php +79 -31
js/wpbe-admin-script.js CHANGED
@@ -27,7 +27,7 @@ jQuery(document).ready(function($){
27
  // Trigger help
28
  $('.wpbe_help').on('click', this, function(e){
29
  e.preventDefault();
30
- $('a#contextual-help-link').trigger('click');
31
  });
32
 
33
  // Thickbox preview
27
  // Trigger help
28
  $('.wpbe_help').on('click', this, function(e){
29
  e.preventDefault();
30
+ $('#contextual-help-link').trigger('click');
31
  });
32
 
33
  // Thickbox preview
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === WP Better Emails ===
2
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=7Q49VJQNRCQ8E&lc=FR&item_name=ArtyShow&item_number=wp%2dbetter%2demails&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
3
- Tags: email, emails, html emails, templates, notification, wp_mail, wpmu, multisite
4
  Requires at least: 2.8
5
- Tested up to: 4.1
6
- Stable tag: 0.2.8
7
 
8
- Adds a customizable good looking HTML template to all WP default text/plain emails and lets you set
9
  a custom sender name and email address.
10
 
11
  == Description ==
@@ -29,9 +29,10 @@ replaced when sending the email.
29
 
30
  = Example usages : =
31
 
 
32
  * Add some ads/sponsored links to every email sent with wordpress
33
  * Include some banners to promote a special event or feature of your website
34
- * Brand your emails to your website or client website
35
 
36
  = Internationalization =
37
 
@@ -58,6 +59,11 @@ WP Better Emails is currently available in :
58
  I'm looking for translators to extend to other languages. If you have translated the plugin in your language or want to,
59
  please let me know : wpbetteremails [ at ] helloni.co
60
 
 
 
 
 
 
61
  = Contributing =
62
 
63
  WP Better Emails is also available on [GitHub](https://github.com/nlemoine/WP-Better-Emails).
@@ -128,6 +134,14 @@ The key of the array `sponsored_link` will be a new tag (`%sponsored_link%`) you
128
  The example above is taking sponsored links as an additinonal content but you can imagine anything like including lastest posts, a quote of the day or whatever.
129
  You can place this function in your functions.php theme file or in a plugin.
130
 
 
 
 
 
 
 
 
 
131
  == Screenshots ==
132
 
133
  1. The default template provided with WP Better Emails. Tested on many email clients like Gmail, Yahoo!, Live/Hotmail, etc.
@@ -138,6 +152,14 @@ You can place this function in your functions.php theme file or in a plugin.
138
 
139
  == Changelog ==
140
 
 
 
 
 
 
 
 
 
141
  = 0.2.8 =
142
 
143
  * Added translation: Vietnamese
1
  === WP Better Emails ===
2
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=7Q49VJQNRCQ8E&lc=FR&item_name=ArtyShow&item_number=wp%2dbetter%2demails&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
3
+ Tags: email, emails, email template, email templates, emails templates, html template, html emails, html template, templates, notification, wp_mail, wpmu, multisite, wpmandrill, mandrill, wordpress email, worpress email template
4
  Requires at least: 2.8
5
+ Tested up to: 4.8
6
+ Stable tag: 0.3
7
 
8
+ Adds a customizable good looking HTML email template to all WP default text/plain emails and lets you set
9
  a custom sender name and email address.
10
 
11
  == Description ==
29
 
30
  = Example usages : =
31
 
32
+ * Brand your emails to your website or client website
33
  * Add some ads/sponsored links to every email sent with wordpress
34
  * Include some banners to promote a special event or feature of your website
35
+
36
 
37
  = Internationalization =
38
 
59
  I'm looking for translators to extend to other languages. If you have translated the plugin in your language or want to,
60
  please let me know : wpbetteremails [ at ] helloni.co
61
 
62
+ = Support =
63
+
64
+ This plugin is free and developed on my spare time. Please consider reading the [FAQ](https://wordpress.org/plugins/wp-better-emails/faq/) and the [support guide](https://wordpress.org/support/topic/support-guide-read-me-before-posting?replies=1) before posting new topics. Many of them have already been resolved.
65
+
66
+
67
  = Contributing =
68
 
69
  WP Better Emails is also available on [GitHub](https://github.com/nlemoine/WP-Better-Emails).
134
  The example above is taking sponsored links as an additinonal content but you can imagine anything like including lastest posts, a quote of the day or whatever.
135
  You can place this function in your functions.php theme file or in a plugin.
136
 
137
+ = Do you provide hooks to alter some WP Better Emails behaviors? =
138
+
139
+ * wpbe_html_body (filter) will let you apply your own logic on HTML emails
140
+ * wpbe_plaintext_body (filter) will let you apply your own logic on plain text emails
141
+ * wpbe_convert_line_breaks (filter) will let remove line breaks conversion
142
+ * wpbe_convert_urls (filter) will let you remove links conversion
143
+
144
+
145
  == Screenshots ==
146
 
147
  1. The default template provided with WP Better Emails. Tested on many email clients like Gmail, Yahoo!, Live/Hotmail, etc.
152
 
153
  == Changelog ==
154
 
155
+ = 0.3 =
156
+
157
+ * Add proper multisite support: options are saved network wide
158
+ * Remove strip_tags from message as it deletes password retrieve link from lost password email (see: https://wordpress.org/support/topic/password-reset-url-in-plain-version-password-reset-emails-not-showing?replies=3)
159
+ * Improve from name and email, they are only set when default email is used
160
+ * Fix help tab link
161
+ * Add new filters to control converting line breaks to `br` tags and URls to links
162
+
163
  = 0.2.8 =
164
 
165
  * Added translation: Vietnamese
wpbe-options.php CHANGED
@@ -59,9 +59,9 @@
59
  <!-- Support -->
60
  <div id="wpbe_support">
61
  <h3><?php _e('Support & bug report', 'wp-better-emails'); ?></h3>
62
- <p><?php printf(__('If you have any idea to improve this plugin or any bug to report, please email me at : <a href="%1$s">%2$s</a>', 'wp-better-emails'), 'mailto:wpbetteremails@iamnico.la?subject=[wp-better-emails]', 'wpbetteremails@iamnico.la'); ?></p>
63
  <?php $donation_link = 'https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=7Q49VJQNRCQ8E&lc=FR&item_name=ArtyShow&item_number=wp%2dbetter%2demails&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted'; ?>
64
  <p><?php printf(__('You like this plugin ? You use it in a business context ? Please, consider a <a href="%s" target="_blank" rel="external">donation</a>.', 'wp-better-emails'), $donation_link ); ?></p>
65
  <p><?php printf(__('You can still provide some support by <a href="%1$s" target="_blank">voting for it</a> and/or says that <a href="%2$s" target="_blank">it works</a> for your WordPress installation on the official WordPress plugins repository.', 'wp-better-emails'), 'http://wordpress.org/plugins/wp-better-emails/', 'http://wordpress.org/plugins/wp-better-emails/'); ?></p>
66
  </div>
67
- </div>
59
  <!-- Support -->
60
  <div id="wpbe_support">
61
  <h3><?php _e('Support & bug report', 'wp-better-emails'); ?></h3>
62
+ <p><?php printf(__('If you have any idea to improve this plugin or any bug to report, please email me at : <a href="%1$s">%2$s</a>', 'wp-better-emails'), 'mailto:wpbetteremails@helloni.co?subject=[wp-better-emails]', 'wpbetteremails@helloni.co'); ?></p>
63
  <?php $donation_link = 'https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=7Q49VJQNRCQ8E&lc=FR&item_name=ArtyShow&item_number=wp%2dbetter%2demails&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted'; ?>
64
  <p><?php printf(__('You like this plugin ? You use it in a business context ? Please, consider a <a href="%s" target="_blank" rel="external">donation</a>.', 'wp-better-emails'), $donation_link ); ?></p>
65
  <p><?php printf(__('You can still provide some support by <a href="%1$s" target="_blank">voting for it</a> and/or says that <a href="%2$s" target="_blank">it works</a> for your WordPress installation on the official WordPress plugins repository.', 'wp-better-emails'), 'http://wordpress.org/plugins/wp-better-emails/', 'http://wordpress.org/plugins/wp-better-emails/'); ?></p>
66
  </div>
67
+ </div>
wpbe.php CHANGED
@@ -3,8 +3,8 @@
3
  Plugin Name: WP Better Emails
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-better-emails/
5
  Description: Beautify the default text/plain WP mails into fully customizable HTML emails.
6
- Version: 0.2.8
7
- Author: ArtyShow
8
  Author URI: http://wordpress.org/extend/plugins/wp-better-emails/
9
  License: GPLv2
10
  */
@@ -52,14 +52,14 @@ if ( ! class_exists( 'WP_Better_Emails' ) ) {
52
  $this->get_options();
53
 
54
  // Front end filter
55
- add_filter( 'wp_mail_from_name', array( $this, 'set_from_name' ) );
56
- add_filter( 'wp_mail_from', array( $this, 'set_from_email' ) );
57
  add_filter( 'wp_mail_content_type', array( $this, 'set_content_type' ), 100 );
58
  add_action( 'phpmailer_init', array( $this, 'send_html' ) );
59
  add_filter( 'mandrill_payload', array( $this, 'wpmandrill_compatibility' ) );
60
 
61
- if ( ! is_admin() )
62
  return;
 
63
 
64
  // Load translations
65
  load_plugin_textdomain( 'wp-better-emails', null, basename( dirname( __FILE__ ) ) . '/langs/' );
@@ -69,11 +69,13 @@ if ( ! class_exists( 'WP_Better_Emails' ) ) {
69
  add_action( 'admin_menu', array( $this, 'admin_menu' ) );
70
  add_action( 'wp_ajax_send_preview', array( $this, 'ajax_send_preview' ) );
71
 
72
- if ( version_compare( $wp_version, '3.2.1', '<=' ) )
73
  add_action( 'admin_head', array( $this, 'load_wp_tiny_mce' ) );
 
74
 
75
- if ( version_compare( $wp_version, '3.2', '<' ) && version_compare( $wp_version, '3.0.6', '>' ) )
76
  add_action( 'admin_print_footer_scripts', 'wp_tiny_mce_preload_dialogs' );
 
77
 
78
  // Filters
79
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'settings_link' ) );
@@ -157,7 +159,7 @@ For any requests, please contact %admin_email%';
157
  * @since 0.1
158
  * @global $wp_version
159
  */
160
- function install() {
161
  global $wp_version;
162
  // Prevent activation if requirements are not met
163
  // WP 2.8 required
@@ -167,7 +169,20 @@ For any requests, please contact %admin_email%';
167
  wp_die( __( 'WP Better Emails requires WordPress 2.8 or newer.', 'wp-better-emails' ), __( 'Upgrade your Wordpress installation.', 'wp-better-emails' ) );
168
  }
169
 
170
- $this->set_options();
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  }
172
 
173
  /**
@@ -192,8 +207,9 @@ For any requests, please contact %admin_email%';
192
  function is_wpbe_page() {
193
  global $page_hook;
194
 
195
- if ( $page_hook === $this->page )
196
  return true;
 
197
 
198
  return false;
199
  }
@@ -288,7 +304,6 @@ For any requests, please contact %admin_email%';
288
 
289
  $input['plaintext_template'] = $input['plaintext_template'];
290
 
291
-
292
  return $input;
293
  }
294
 
@@ -299,18 +314,21 @@ For any requests, please contact %admin_email%';
299
  * @param string $email
300
  */
301
  function ajax_send_preview( $email ) {
302
- if ( ! current_user_can( 'manage_options' ) )
303
  die();
 
304
 
305
  check_ajax_referer( 'email_preview' );
306
 
307
  $preview_email = sanitize_email( $_POST['preview_email'] );
308
 
309
- if ( empty( $preview_email ) )
310
  die( '<div class="error"><p>' . __( 'Please enter an email', 'wp-better-emails' ) . '</p></div>' );
 
311
 
312
- if ( ! is_email( $preview_email ) )
313
  die( '<div class="error"><p>' . __( 'Please enter a valid email', 'wp-better-emails' ) . '</p></div>' );
 
314
 
315
  // Setup preview message content
316
  $message = __( 'Hey !', 'wp-better-emails' );
@@ -392,16 +410,33 @@ For any requests, please contact %admin_email%';
392
  }
393
 
394
  /**
395
- * Replaces sender email if set & valid
 
396
  *
397
- * @since 0.1
398
- * @param string $from_email
399
- * @return string
400
  */
401
- function set_from_email( $from_email ) {
402
- if ( ! empty( $this->options['from_email'] ) && is_email( $this->options['from_email'] ) )
403
- return $this->options['from_email'];
 
 
 
 
404
 
 
 
 
 
 
 
 
 
 
 
 
 
 
405
  return $from_email;
406
  }
407
 
@@ -413,8 +448,9 @@ For any requests, please contact %admin_email%';
413
  * @return string
414
  */
415
  function set_from_name( $from_name ) {
416
- if ( ! empty( $this->options['from_name'] ) )
417
  return wp_specialchars_decode( $this->options['from_name'], ENT_QUOTES );
 
418
 
419
  return $from_name;
420
  }
@@ -477,7 +513,7 @@ For any requests, please contact %admin_email%';
477
  */
478
  function process_email_text( $message ) {
479
 
480
- $message = strip_tags( $message );
481
 
482
  // Decode body
483
  $message = wp_specialchars_decode( $message, ENT_QUOTES );
@@ -503,8 +539,15 @@ For any requests, please contact %admin_email%';
503
  // Clean < and > around text links in WP 3.1
504
  $message = $this->esc_textlinks( $message );
505
 
506
- // Convert line breaks & make links clickable
507
- $message = nl2br( make_clickable( $message ) );
 
 
 
 
 
 
 
508
 
509
  // Add template to message
510
  $message = $this->set_email_template( $message );
@@ -537,8 +580,9 @@ For any requests, please contact %admin_email%';
537
  * @param string $screen
538
  */
539
  function contextual_help( $contextual_help, $screen_id, $screen ) {
540
- if ( ! $this->is_wpbe_page() )
541
  return $contextual_help;
 
542
 
543
  return '<p>' . __( 'Some dynamic tags can be included in your email template :', 'wp-better-emails' ) . '</p>
544
  <ul>
@@ -568,8 +612,9 @@ For any requests, please contact %admin_email%';
568
  function tinymce_plugins( $external_plugins ) {
569
  global $wp_version;
570
 
571
- if ( ! $this->is_wpbe_page() )
572
  return $external_plugins;
 
573
 
574
  $fullpage = array();
575
 
@@ -602,8 +647,9 @@ For any requests, please contact %admin_email%';
602
  * @return type
603
  */
604
  function tinymce_buttons( $buttons ) {
605
- if ( $this->is_wpbe_page() )
606
  array_push( $buttons, 'cmseditor' );
 
607
 
608
  return $buttons;
609
  }
@@ -621,8 +667,9 @@ For any requests, please contact %admin_email%';
621
  $init['remove_linebreaks'] = false;
622
  $init['content_css'] = ''; // WP =< 3.0
623
 
624
- if ( isset( $init['extended_valid_elements'] ) )
625
  $init['extended_valid_elements'] = $init['extended_valid_elements'] . ',td[*]';
 
626
 
627
  return $init;
628
  }
@@ -633,8 +680,9 @@ For any requests, please contact %admin_email%';
633
  * @since 0.2
634
  */
635
  function load_wp_tiny_mce() {
636
- if ( ! $this->is_wpbe_page() )
637
  return;
 
638
 
639
  $settings = array(
640
  'editor_selector' => 'wpbe_template',
@@ -687,5 +735,5 @@ For any requests, please contact %admin_email%';
687
 
688
  if ( class_exists( 'WP_Better_Emails' ) ) {
689
  $wp_better_emails = new WP_Better_Emails();
690
- register_activation_hook( __FILE__, array( $wp_better_emails, 'install' ) );
691
  }
3
  Plugin Name: WP Better Emails
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-better-emails/
5
  Description: Beautify the default text/plain WP mails into fully customizable HTML emails.
6
+ Version: 0.3
7
+ Author: Nicolas Lemoine
8
  Author URI: http://wordpress.org/extend/plugins/wp-better-emails/
9
  License: GPLv2
10
  */
52
  $this->get_options();
53
 
54
  // Front end filter
55
+ add_filter( 'wp_mail_from', array( $this, 'set_from' ) );
 
56
  add_filter( 'wp_mail_content_type', array( $this, 'set_content_type' ), 100 );
57
  add_action( 'phpmailer_init', array( $this, 'send_html' ) );
58
  add_filter( 'mandrill_payload', array( $this, 'wpmandrill_compatibility' ) );
59
 
60
+ if ( ! is_admin() ) {
61
  return;
62
+ }
63
 
64
  // Load translations
65
  load_plugin_textdomain( 'wp-better-emails', null, basename( dirname( __FILE__ ) ) . '/langs/' );
69
  add_action( 'admin_menu', array( $this, 'admin_menu' ) );
70
  add_action( 'wp_ajax_send_preview', array( $this, 'ajax_send_preview' ) );
71
 
72
+ if ( version_compare( $wp_version, '3.2.1', '<=' ) ) {
73
  add_action( 'admin_head', array( $this, 'load_wp_tiny_mce' ) );
74
+ }
75
 
76
+ if ( version_compare( $wp_version, '3.2', '<' ) && version_compare( $wp_version, '3.0.6', '>' ) ) {
77
  add_action( 'admin_print_footer_scripts', 'wp_tiny_mce_preload_dialogs' );
78
+ }
79
 
80
  // Filters
81
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'settings_link' ) );
159
  * @since 0.1
160
  * @global $wp_version
161
  */
162
+ function activate() {
163
  global $wp_version;
164
  // Prevent activation if requirements are not met
165
  // WP 2.8 required
169
  wp_die( __( 'WP Better Emails requires WordPress 2.8 or newer.', 'wp-better-emails' ), __( 'Upgrade your Wordpress installation.', 'wp-better-emails' ) );
170
  }
171
 
172
+ if ( ! is_multisite() ) {
173
+ $this->set_options();
174
+ } else {
175
+ global $wpdb;
176
+ $all_blogs = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
177
+ if ( is_array( $all_blogs ) && $all_blogs !== array() ) {
178
+ foreach ( $all_blogs as $blog_id ) {
179
+ switch_to_blog( $blog_id );
180
+ $this->set_options();
181
+ restore_current_blog();
182
+ }
183
+ }
184
+ }
185
+
186
  }
187
 
188
  /**
207
  function is_wpbe_page() {
208
  global $page_hook;
209
 
210
+ if ( $page_hook === $this->page ) {
211
  return true;
212
+ }
213
 
214
  return false;
215
  }
304
 
305
  $input['plaintext_template'] = $input['plaintext_template'];
306
 
 
307
  return $input;
308
  }
309
 
314
  * @param string $email
315
  */
316
  function ajax_send_preview( $email ) {
317
+ if ( ! current_user_can( 'manage_options' ) ) {
318
  die();
319
+ }
320
 
321
  check_ajax_referer( 'email_preview' );
322
 
323
  $preview_email = sanitize_email( $_POST['preview_email'] );
324
 
325
+ if ( empty( $preview_email ) ) {
326
  die( '<div class="error"><p>' . __( 'Please enter an email', 'wp-better-emails' ) . '</p></div>' );
327
+ }
328
 
329
+ if ( ! is_email( $preview_email ) ) {
330
  die( '<div class="error"><p>' . __( 'Please enter a valid email', 'wp-better-emails' ) . '</p></div>' );
331
+ }
332
 
333
  // Setup preview message content
334
  $message = __( 'Hey !', 'wp-better-emails' );
410
  }
411
 
412
  /**
413
+ * Get default from email
414
+ * Copy pasted from wp_mail
415
  *
416
+ * @see wp_mail
417
+ * @return string Default from email
 
418
  */
419
+ function get_default_from_email() {
420
+ $sitename = strtolower( $_SERVER['SERVER_NAME'] );
421
+ if ( substr( $sitename, 0, 4 ) == 'www.' ) {
422
+ $sitename = substr( $sitename, 4 );
423
+ }
424
+ return 'wordpress@' . $sitename;
425
+ }
426
 
427
+ /**
428
+ * Set from email and from name only in case default email and name is used
429
+ *
430
+ * @param string $from_email From email
431
+ */
432
+ function set_from( $from_email ) {
433
+ // Only apply custom from name and email if default email is used
434
+ if( $this->get_default_from_email() === $from_email ) {
435
+ add_filter( 'wp_mail_from_name', array( $this, 'set_from_name' ) );
436
+ if ( ! empty( $this->options['from_email'] ) && is_email( $this->options['from_email'] ) ) {
437
+ return $this->options['from_email'];
438
+ }
439
+ }
440
  return $from_email;
441
  }
442
 
448
  * @return string
449
  */
450
  function set_from_name( $from_name ) {
451
+ if ( ! empty( $this->options['from_name'] ) ) {
452
  return wp_specialchars_decode( $this->options['from_name'], ENT_QUOTES );
453
+ }
454
 
455
  return $from_name;
456
  }
513
  */
514
  function process_email_text( $message ) {
515
 
516
+ //$message = strip_tags( $message );
517
 
518
  // Decode body
519
  $message = wp_specialchars_decode( $message, ENT_QUOTES );
539
  // Clean < and > around text links in WP 3.1
540
  $message = $this->esc_textlinks( $message );
541
 
542
+ // Convert line breaks
543
+ if( apply_filters( 'wpbe_convert_line_breaks', true ) ) {
544
+ $message = nl2br( $message );
545
+ }
546
+
547
+ // Convert URLs to links
548
+ if( apply_filters( 'wpbe_convert_urls', true ) ) {
549
+ $message = make_clickable( $message );
550
+ }
551
 
552
  // Add template to message
553
  $message = $this->set_email_template( $message );
580
  * @param string $screen
581
  */
582
  function contextual_help( $contextual_help, $screen_id, $screen ) {
583
+ if ( ! $this->is_wpbe_page() ) {
584
  return $contextual_help;
585
+ }
586
 
587
  return '<p>' . __( 'Some dynamic tags can be included in your email template :', 'wp-better-emails' ) . '</p>
588
  <ul>
612
  function tinymce_plugins( $external_plugins ) {
613
  global $wp_version;
614
 
615
+ if ( ! $this->is_wpbe_page() ) {
616
  return $external_plugins;
617
+ }
618
 
619
  $fullpage = array();
620
 
647
  * @return type
648
  */
649
  function tinymce_buttons( $buttons ) {
650
+ if ( $this->is_wpbe_page() ) {
651
  array_push( $buttons, 'cmseditor' );
652
+ }
653
 
654
  return $buttons;
655
  }
667
  $init['remove_linebreaks'] = false;
668
  $init['content_css'] = ''; // WP =< 3.0
669
 
670
+ if ( isset( $init['extended_valid_elements'] ) ) {
671
  $init['extended_valid_elements'] = $init['extended_valid_elements'] . ',td[*]';
672
+ }
673
 
674
  return $init;
675
  }
680
  * @since 0.2
681
  */
682
  function load_wp_tiny_mce() {
683
+ if ( ! $this->is_wpbe_page() ) {
684
  return;
685
+ }
686
 
687
  $settings = array(
688
  'editor_selector' => 'wpbe_template',
735
 
736
  if ( class_exists( 'WP_Better_Emails' ) ) {
737
  $wp_better_emails = new WP_Better_Emails();
738
+ register_activation_hook( __FILE__, array( $wp_better_emails, 'activate' ) );
739
  }