Better Notifications for WordPress - Version 1.3.3

Version Description

  • New: You can now send a notification to the Post Author only, where a notification supports it.
  • New: There is now an option in the Settings screen to globally set WordPress to send emails in either HTML or Plain Text. Please read the FAQ for more information about this as there is a small caveat.
  • New: Support for WordPress 4.3.
  • New: Pending posts that are changed to Published now trigger the 'New Post / Page Notification'.
  • Improved: Scheduled notifications now trigger two notifications, one for when they're saved as Scheduled ('Post Scheduled' / 'Page Scheduled') and one for when they're actually published ('New Post Published / New Page Published').
  • Improved: Swapped the green tick for a dashicons tick for a slightly more speedier, native-feeling plugin.
  • Improved: Reduced the flash of hidden elements when loading the New / Edit Notification screen.
  • Fixed: WordPress 4.3 doesn't allow passwords to be automatically created for new users and will instead, send them to a password generator page. The [password] shortcode has been replaced with [password_url]. [password] should still work though so it won't break your existing notifications.
  • Fixed: Some output was being showed when WP_DEBUG was enabled.
  • Fixed: Removed the 'slug' field when enabled from Screen Options.
Download this release

Release Info

Developer voltronik
Plugin Icon 128x128 Better Notifications for WordPress
Version 1.3.3
Comparing to
See all releases

Code changes from version 1.3.2 to 1.3.3

README.txt CHANGED
@@ -1,18 +1,18 @@
1
  === Better Notifications for WordPress ===
2
  Contributors: voltronik
3
- Tags: notifications, email, mail, alerts, roles, user, users, admin, HTML, plain, wp_mail, shortcode, customize, post, page, updated, pending review, scheduled, category, tag, term, custom post type, comment, akismet, trackback, pingback, lost password, welcome, new user, bulk, notice, trigger, CC, BCC, from
4
  Requires at least: 3.5
5
- Tested up to: 4.2.2
6
- Stable tag: 1.3.2
7
  License: GPLv2 or later
8
 
9
- Send customisable HTML emails to your users for different WordPress notifications.
10
 
11
  == Description ==
12
 
13
  > Recently updated to be even easier to use!
14
 
15
- Better Notifications for WordPress allows you to generate custom HTML email notifications and send them to user roles (including custom roles) or individual users for all kinds of things happening on your WordPress website. Emails are sent out via your WordPress website (using `wp_mail`) but can be sent via SMTP using an appropriate 3rd party plugin should you wish.
16
 
17
  = For example: =
18
  You want a user with the editor role (or all users using the Editor role) to be alerted via email when a new post is published and you'd like to customise it to include your branding along with the author's display name and post time - with this plugin, that's easy.
@@ -34,6 +34,7 @@ Notifications that are currently available to use are:
34
  * Lost Password (For User)
35
  * New User Registration (For User)
36
  * New User - Welcome Email
 
37
 
38
  **Posts / Custom Post Types**
39
 
@@ -116,9 +117,9 @@ This will very much depend on what notifications you're using the plugin for. Ou
116
 
117
  * If you want to use the 'Comment Reply' transactional email, you need to ensure that comments are only set-up to be 2-levels deep. You can do this by going to Settings > Discussion and changing the option 'Enable threaded (nested) comments 'X' levels deep' to '2'. Please also ensure this option is ticked.
118
 
119
- = Configured emails aren't coming through! =
120
 
121
- Check your settings to make sure all is as it should be, then check your spam folder and/or filter at your host. Gmail and certain hosts can mark messages from new websites (or IP addresses) as spam so it's worth checking and possibly creating a filter to ensure this doesn't happen in the future.
122
 
123
  Many hosts place a limit on the number of emails that can be sent out within an hour so this may also cause some delay in emails arriving.
124
 
@@ -130,6 +131,10 @@ It's possible you're inserting a shortcode into a notification that cannot use i
130
 
131
  Check that you've saved your notification first, then try again. It may take a second for the email to come through. Please also check your email SPAM filter.
132
 
 
 
 
 
133
  = Custom Post Type 'X' isn't showing in the list of available custom post types =
134
 
135
  This is most likely because it's `public` setting is set to `false`. Try changing this and see if it shows up in the list. If the custom post type has been created by a plugin and is set to private (such as [TablePress](https://wordpress.org/plugins/tablepress/ "TablePress")), you'll need to get in touch with the plugin author to see if they'll consider changing it to public instead so that BNFW can send out notifications for it.
@@ -142,7 +147,7 @@ In order to fix a problem with P2 not triggering notifications at all, if you po
142
 
143
  Yes, of course! The plugin is completely translation-friendly and if you send me your .po file, i'll make sure to include it in the plugin and credit you on this page.
144
 
145
- = Will this plugin work with versions WordPress less than 3.5? =
146
 
147
  It might do but this is untested.
148
 
@@ -160,6 +165,18 @@ It might do but this is untested.
160
 
161
  == Changelog ==
162
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  = 1.3.2 =
164
  * Fixed: Replaced a deprecated function which might cause a warning to show when `WP_DEBUG` was enabled.
165
 
@@ -253,7 +270,7 @@ It might do but this is untested.
253
  * Minor Bugfixes
254
 
255
  = 0.2 beta =
256
- * Added an option to suppress spam comment notifications.
257
 
258
  = 0.1 beta =
259
  * Initial version of the plugin.
1
  === Better Notifications for WordPress ===
2
  Contributors: voltronik
3
+ Tags: notifications, email, mail, alerts, roles, user, users, admin, HTML, plain, wp_mail, shortcode, customize, post, page, updated, pending review, scheduled, category, tag, term, custom post type, comment, akismet, trackback, pingback, lost password, welcome, new user, bulk, notice, trigger, CC, BCC, from, author
4
  Requires at least: 3.5
5
+ Tested up to: 4.3
6
+ Stable tag: 1.3.3
7
  License: GPLv2 or later
8
 
9
+ Send customisable emails to your users for different WordPress notifications.
10
 
11
  == Description ==
12
 
13
  > Recently updated to be even easier to use!
14
 
15
+ Better Notifications for WordPress allows you to generate custom email notifications and send them to user roles (including custom roles) or individual users for all kinds of things happening on your WordPress website. Emails are sent out via your WordPress website (using `wp_mail`) but can be sent via SMTP using an appropriate 3rd party plugin should you wish.
16
 
17
  = For example: =
18
  You want a user with the editor role (or all users using the Editor role) to be alerted via email when a new post is published and you'd like to customise it to include your branding along with the author's display name and post time - with this plugin, that's easy.
34
  * Lost Password (For User)
35
  * New User Registration (For User)
36
  * New User - Welcome Email
37
+ * Comment Reply
38
 
39
  **Posts / Custom Post Types**
40
 
117
 
118
  * If you want to use the 'Comment Reply' transactional email, you need to ensure that comments are only set-up to be 2-levels deep. You can do this by going to Settings > Discussion and changing the option 'Enable threaded (nested) comments 'X' levels deep' to '2'. Please also ensure this option is ticked.
119
 
120
+ = Notifications aren't coming through! =
121
 
122
+ Check your settings to make sure all is as it should be, then check your SPAM folder and/or filter at your host. Gmail and certain hosts can mark messages from new websites (or IP addresses) as SPAM so it's worth checking and possibly creating a filter to ensure this doesn't happen in the future.
123
 
124
  Many hosts place a limit on the number of emails that can be sent out within an hour so this may also cause some delay in emails arriving.
125
 
131
 
132
  Check that you've saved your notification first, then try again. It may take a second for the email to come through. Please also check your email SPAM filter.
133
 
134
+ = Other emails from WordPress / other plugins are being messed up! =
135
+
136
+ WordPress, by default, sends all emails in Plain Text. If you'd like to include code or use the WYSIWYG editor as part of Better Notifications for WordPress in your emails, you can change this to HTML using the global setting in Better Notification for WordPress. This can be found under the 'Notifications > Settings' screen. Changing this global email format setting will affect how all emails are sent out from WordPress however, so you may experience formatting issues with emails sent out from other plugins if you change the email format setting in this way. If you do, change this setting to Plain Text. You can also set the email format on a per-notification basis when setting-up a new Notification. The caveat is that WordPress will only either allow setting the email format globally (for all emails) or individually for anything that's non-transactional.
137
+
138
  = Custom Post Type 'X' isn't showing in the list of available custom post types =
139
 
140
  This is most likely because it's `public` setting is set to `false`. Try changing this and see if it shows up in the list. If the custom post type has been created by a plugin and is set to private (such as [TablePress](https://wordpress.org/plugins/tablepress/ "TablePress")), you'll need to get in touch with the plugin author to see if they'll consider changing it to public instead so that BNFW can send out notifications for it.
147
 
148
  Yes, of course! The plugin is completely translation-friendly and if you send me your .po file, i'll make sure to include it in the plugin and credit you on this page.
149
 
150
+ = Will this plugin work with versions of WordPress less than 3.5? =
151
 
152
  It might do but this is untested.
153
 
165
 
166
  == Changelog ==
167
 
168
+ = 1.3.3 =
169
+ * New: You can now send a notification to the Post Author only, where a notification supports it.
170
+ * New: There is now an option in the Settings screen to globally set WordPress to send emails in either HTML or Plain Text. Please read the [FAQ](https://wordpress.org/plugins/bnfw/faq/) for more information about this as there is a small caveat.
171
+ * New: Support for WordPress 4.3.
172
+ * New: Pending posts that are changed to Published now trigger the 'New Post / Page Notification'.
173
+ * Improved: Scheduled notifications now trigger two notifications, one for when they're saved as Scheduled ('Post Scheduled' / 'Page Scheduled') and one for when they're actually published ('New Post Published / New Page Published').
174
+ * Improved: Swapped the green tick for a dashicons tick for a slightly more speedier, native-feeling plugin.
175
+ * Improved: Reduced the flash of hidden elements when loading the New / Edit Notification screen.
176
+ * Fixed: WordPress 4.3 doesn't allow passwords to be automatically created for new users and will instead, send them to a password generator page. The `[password]` shortcode has been replaced with `[password_url]`. `[password]` should still work though so it won't break your existing notifications.
177
+ * Fixed: Some output was being showed when WP_DEBUG was enabled.
178
+ * Fixed: Removed the 'slug' field when enabled from Screen Options.
179
+
180
  = 1.3.2 =
181
  * Fixed: Replaced a deprecated function which might cause a warning to show when `WP_DEBUG` was enabled.
182
 
270
  * Minor Bugfixes
271
 
272
  = 0.2 beta =
273
+ * Added an option to suppress SPAM comment notifications.
274
 
275
  = 0.1 beta =
276
  * Initial version of the plugin.
assets/css/bnfw.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ #user-password-msg {
2
+ display: none;
3
+ }
4
+
5
+ #user-password-msg div {
6
+ background: #FFFFE1;
7
+ padding: 15px;
8
+ }
assets/images/notification-enabled.png DELETED
Binary file
assets/js/bnfw.js CHANGED
@@ -9,27 +9,50 @@ jQuery(document).ready(function($) {
9
  }
10
  }
11
 
12
- $(".select2").select2();
13
- toggle_fields();
 
 
 
 
 
14
 
15
- if ( 'user-password' === $('#notification').val() || 'new-user' === $('#notification').val() || 'welcome-email' === $('#notification').val() || 'reply-comment' === $('#notification').val() ) {
16
- $('#toggle-fields, #email, #cc, #bcc, #users, #email-formatting, #current-user').hide();
17
- $('#user-password-msg').show();
18
- } else {
19
- $('#toggle-fields, #users, #email-formatting, #current-user').show();
20
  toggle_fields();
21
- $('#user-password-msg').hide();
22
- }
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  $('#notification').on('change', function() {
25
  var $this = $(this);
26
  if ( 'user-password' === $this.val() || 'new-user' === $this.val() || 'welcome-email' === $this.val() || 'reply-comment' === $this.val() ) {
27
- $('#toggle-fields, #email, #cc, #bcc, #users, #email-formatting, #current-user').hide();
28
  $('#user-password-msg').show();
29
- } else {
 
30
  $('#toggle-fields, #users, #email-formatting, #current-user').show();
31
  $('#user-password-msg').hide();
32
  toggle_fields();
 
 
 
 
33
  }
34
  });
35
 
@@ -37,6 +60,10 @@ jQuery(document).ready(function($) {
37
  toggle_fields();
38
  });
39
 
 
 
 
 
40
  // send test email
41
  $( '#test-email' ).click(function() {
42
  $( '#send-test-email' ).val( 'true' );
9
  }
10
  }
11
 
12
+ function toggle_users() {
13
+ if ( $( '#only-post-author' ).is( ':checked' ) ) {
14
+ $( '#users, #current-user' ).hide();
15
+ } else {
16
+ $( '#users, #current-user' ).show();
17
+ }
18
+ }
19
 
20
+ function init() {
21
+ $(".select2").select2();
 
 
 
22
  toggle_fields();
 
 
23
 
24
+ if ( 'user-password' === $('#notification').val() || 'new-user' === $('#notification').val() || 'welcome-email' === $('#notification').val() || 'reply-comment' === $('#notification').val() ) {
25
+ $('#toggle-fields, #email, #cc, #bcc, #users, #email-formatting, #current-user, #post-author').hide();
26
+ $('#user-password-msg').show();
27
+ } else if ( 'new-comment' === $('#notification').val() || 'new-trackback' === $('#notification').val() || 'new-pingback' === $('#notification').val() || 'admin-password' === $('#notification').val() || 'admin-user' === $('#notification').val() ) {
28
+ $('#toggle-fields, #users, #email-formatting, #current-user').show();
29
+ $('#only-post-author').prop( 'checked', false );
30
+ $('#post-author').hide();
31
+ toggle_fields();
32
+ $('#user-password-msg').hide();
33
+ } else {
34
+ $('#toggle-fields, #users, #email-formatting, #current-user, #post-author').show();
35
+ toggle_fields();
36
+ toggle_users();
37
+ $('#user-password-msg').hide();
38
+ }
39
+ }
40
+
41
+ init();
42
  $('#notification').on('change', function() {
43
  var $this = $(this);
44
  if ( 'user-password' === $this.val() || 'new-user' === $this.val() || 'welcome-email' === $this.val() || 'reply-comment' === $this.val() ) {
45
+ $('#toggle-fields, #email, #cc, #bcc, #users, #email-formatting, #current-user, #post-author').hide();
46
  $('#user-password-msg').show();
47
+ } else if ( 'new-comment' === $('#notification').val() || 'new-trackback' === $('#notification').val() || 'new-pingback' === $('#notification').val() || 'admin-password' === $('#notification').val() || 'admin-user' === $('#notification').val() ) {
48
+ $('#post-author').hide();
49
  $('#toggle-fields, #users, #email-formatting, #current-user').show();
50
  $('#user-password-msg').hide();
51
  toggle_fields();
52
+ } else {
53
+ $('#toggle-fields, #users, #email-formatting, #current-user, #post-author').show();
54
+ $('#user-password-msg').hide();
55
+ toggle_fields();
56
  }
57
  });
58
 
60
  toggle_fields();
61
  });
62
 
63
+ $( '#only-post-author' ).change(function() {
64
+ toggle_users();
65
+ } );
66
+
67
  // send test email
68
  $( '#test-email' ).click(function() {
69
  $( '#send-test-email' ).val( 'true' );
bnfw.php CHANGED
@@ -2,8 +2,8 @@
2
  /**
3
  * Plugin Name: Better Notifications for WordPress
4
  * Plugin URI: http://wordpress.org/plugins/bnfw/
5
- * Description: Send customisable HTML emails to your users for different WordPress notifications.
6
- * Version: 1.3.2
7
  * Author: Voltronik
8
  * Author URI: http://www.voltronik.co.uk/
9
  * Author Email: plugins@voltronik.co.uk
@@ -99,6 +99,8 @@ class BNFW {
99
  }
100
 
101
  add_action( 'draft_to_publish' , array( $this, 'publish_post' ) );
 
 
102
  add_action( 'publish_to_publish' , array( $this, 'update_post' ) );
103
  add_action( 'init' , array( $this, 'custom_post_type_hooks' ), 100 );
104
  add_action( 'create_term' , array( $this, 'create_term' ), 10, 3 );
2
  /**
3
  * Plugin Name: Better Notifications for WordPress
4
  * Plugin URI: http://wordpress.org/plugins/bnfw/
5
+ * Description: Send customisable emails to your users for different WordPress notifications.
6
+ * Version: 1.3.3
7
  * Author: Voltronik
8
  * Author URI: http://www.voltronik.co.uk/
9
  * Author Email: plugins@voltronik.co.uk
99
  }
100
 
101
  add_action( 'draft_to_publish' , array( $this, 'publish_post' ) );
102
+ add_action( 'future_to_publish' , array( $this, 'publish_post' ) );
103
+ add_action( 'pending_to_publish' , array( $this, 'publish_post' ) );
104
  add_action( 'publish_to_publish' , array( $this, 'update_post' ) );
105
  add_action( 'init' , array( $this, 'custom_post_type_hooks' ), 100 );
106
  add_action( 'create_term' , array( $this, 'create_term' ), 10, 3 );
includes/admin/bnfw-settings.php CHANGED
@@ -1,113 +1,151 @@
1
- <?php
2
- /**
3
- * Register the Admin pages and load the scripts action
4
- **/
5
-
6
- /**
7
- * Sub-menu pages
8
- */
9
- function bnfw_admin_menu() {
10
-
11
- // New Notifications Sub-menu
12
- add_submenu_page(
13
- 'edit.php?post_type=bnfw_notification',
14
- __( 'Notification Settings', 'bnfw' ),
15
- __( 'Settings', 'bnfw' ),
16
- 'manage_options',
17
- 'bnfw-settings',
18
- 'bnfw_settings_page'
19
- );
20
- }
21
- // Add the Admin pages to the WordPress menu
22
- add_action( 'admin_menu', 'bnfw_admin_menu' );
23
-
24
- /* ------------------------------------------------------------------------ *
25
- * Menu Pages
26
- * ------------------------------------------------------------------------ */
27
-
28
- /**
29
- * Settings Page
30
- */
31
- function bnfw_settings_page() {
32
- ob_start(); ?>
33
-
34
- <div class="wrap">
35
- <?php screen_icon(); ?>
36
- <h2><?php _e( 'BNFW Settings', 'bnfw' ); ?></h2>
37
-
38
- <form method="post" action="options.php" class="bnfw-form">
39
- <?php
40
- settings_errors();
41
- settings_fields( 'bnfw-settings' );
42
- do_settings_sections( 'bnfw-settings' );
43
-
44
- submit_button( 'Save Settings' );
45
- ?>
46
- </form>
47
- </div>
48
-
49
- <?php echo ob_get_clean();
50
- }
51
-
52
- /* ------------------------------------------------------------------------ *
53
- * Settings Page - Setting Registration
54
- * ------------------------------------------------------------------------ */
55
-
56
- /**
57
- *
58
- */
59
- function bnfw_general_options() {
60
-
61
- // Set-up - General Options Section
62
- add_settings_section (
63
- 'bnfw_general_options_section', // Section ID
64
- '', // Title above settings section
65
- 'bnfw_general_options_callback', // Name of function that renders a description of the settings section
66
- 'bnfw-settings' // Page to show on
67
- );
68
-
69
- // Suppress notifications for SPAM comments
70
- add_settings_field (
71
- 'bnfw_suppress_spam', // Field ID
72
- __( 'Suppress SPAM comment notification', 'bnfw' ), // Label to the left
73
- 'bnfw_suppress_spam_checkbox', // Name of function that renders options on the page
74
- 'bnfw-settings', // Page to show on
75
- 'bnfw_general_options_section', // Associate with which settings section?
76
- array(
77
- __( "Don't send notifications for comments marked as SPAM by Akismet", 'bnfw' )
78
- )
79
- );
80
-
81
- // Register - Suppress SPAM Checkbox
82
- register_setting (
83
- 'bnfw-settings',
84
- 'bnfw_suppress_spam'
85
- );
86
- }
87
- add_action( 'admin_init', 'bnfw_general_options' );
88
-
89
- /* ------------------------------------------------------------------------ *
90
- * Settings Page - Settings Section Callbacks
91
- * ------------------------------------------------------------------------ */
92
-
93
- /**
94
- *
95
- */
96
- function bnfw_general_options_callback() {}
97
-
98
- /* ------------------------------------------------------------------------ *
99
- * Settings Page - Settings Field Callbacks
100
- * ------------------------------------------------------------------------ */
101
-
102
- /**
103
- * Suppress SPAM checkbox.
104
- *
105
- * @since 1.0
106
- * @param unknown $args
107
- */
108
- function bnfw_suppress_spam_checkbox( $args ) {
109
- ?>
110
- <input type="checkbox" id="bnfw_suppress_spam" name="bnfw_suppress_spam" value="1" <?php checked( 1, get_option( 'bnfw_suppress_spam' ), true );?>>
111
- <label for="bnfw_suppress_spam"><?php echo $args[0]; ?></label>
112
- <?php
113
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Register the Admin pages and load the scripts action
4
+ */
5
+
6
+ /**
7
+ * Sub-menu pages
8
+ */
9
+ function bnfw_admin_menu() {
10
+
11
+ // New Notifications Sub-menu
12
+ add_submenu_page(
13
+ 'edit.php?post_type=bnfw_notification',
14
+ __( 'Notification Settings', 'bnfw' ),
15
+ __( 'Settings', 'bnfw' ),
16
+ 'manage_options',
17
+ 'bnfw-settings',
18
+ 'bnfw_settings_page'
19
+ );
20
+ }
21
+ // Add the Admin pages to the WordPress menu
22
+ add_action( 'admin_menu', 'bnfw_admin_menu' );
23
+
24
+ /* ------------------------------------------------------------------------ *
25
+ * Menu Pages
26
+ * ------------------------------------------------------------------------ */
27
+
28
+ /**
29
+ * Settings Page
30
+ */
31
+ function bnfw_settings_page() {
32
+ ob_start(); ?>
33
+
34
+ <div class="wrap">
35
+ <?php screen_icon(); ?>
36
+ <h2><?php _e( 'BNFW Settings', 'bnfw' ); ?></h2>
37
+
38
+ <form method="post" action="options.php" class="bnfw-form">
39
+ <?php
40
+ settings_errors();
41
+ settings_fields( 'bnfw-settings' );
42
+ do_settings_sections( 'bnfw-settings' );
43
+
44
+ submit_button( 'Save Settings' );
45
+ ?>
46
+ </form>
47
+ </div>
48
+
49
+ <?php echo ob_get_clean();
50
+ }
51
+
52
+ /* ------------------------------------------------------------------------ *
53
+ * Settings Page - Setting Registration
54
+ * ------------------------------------------------------------------------ */
55
+
56
+ /**
57
+ *
58
+ */
59
+ function bnfw_general_options() {
60
+ // Set-up - General Options Section
61
+ add_settings_section(
62
+ 'bnfw_general_options_section', // Section ID
63
+ '', // Title above settings section
64
+ 'bnfw_general_options_callback', // Name of function that renders a description of the settings section
65
+ 'bnfw-settings' // Page to show on
66
+ );
67
+
68
+ // Register - Suppress SPAM Checkbox
69
+ register_setting(
70
+ 'bnfw-settings',
71
+ 'bnfw_suppress_spam'
72
+ );
73
+
74
+ // Suppress notifications for SPAM comments
75
+ add_settings_field(
76
+ 'bnfw_suppress_spam', // Field ID
77
+ __( 'Suppress SPAM comment notification', 'bnfw' ), // Label to the left
78
+ 'bnfw_suppress_spam_checkbox', // Name of function that renders options on the page
79
+ 'bnfw-settings', // Page to show on
80
+ 'bnfw_general_options_section', // Associate with which settings section?
81
+ array(
82
+ __( "Don't send notifications for comments marked as SPAM by Akismet", 'bnfw' )
83
+ )
84
+ );
85
+
86
+ // Register - Suppress SPAM Checkbox
87
+ register_setting(
88
+ 'bnfw-settings',
89
+ 'bnfw_email_format'
90
+ );
91
+
92
+ // Suppress notifications for SPAM comments
93
+ add_settings_field(
94
+ 'bnfw_email_format', // Field ID
95
+ __( 'Default Email Format', 'bnfw' ), // Label to the left
96
+ 'bnfw_email_format_radio', // Name of function that renders options on the page
97
+ 'bnfw-settings', // Page to show on
98
+ 'bnfw_general_options_section', // Associate with which settings section?
99
+ array(
100
+ __( 'This will apply to all emails sent out via WordPress, even those from other plugins. For more details, please see the <a href="https://wordpress.org/plugins/bnfw/faq/" target="_blank">FAQ</a>.', 'bnfw' )
101
+ )
102
+ );
103
+
104
+ }
105
+ add_action( 'admin_init', 'bnfw_general_options' );
106
+
107
+ /* ------------------------------------------------------------------------ *
108
+ * Settings Page - Settings Section Callbacks
109
+ * ------------------------------------------------------------------------ */
110
+
111
+ /**
112
+ *
113
+ */
114
+ function bnfw_general_options_callback() {}
115
+
116
+ /* ------------------------------------------------------------------------ *
117
+ * Settings Page - Settings Field Callbacks
118
+ * ------------------------------------------------------------------------ */
119
+
120
+ /**
121
+ * Suppress SPAM checkbox.
122
+ *
123
+ * @since 1.0
124
+ * @param unknown $args
125
+ */
126
+ function bnfw_suppress_spam_checkbox( $args ) {
127
+ ?>
128
+ <input type="checkbox" id="bnfw_suppress_spam" name="bnfw_suppress_spam" value="1" <?php checked( 1, get_option( 'bnfw_suppress_spam' ), true );?>>
129
+ <label for="bnfw_suppress_spam"><?php echo $args[0]; ?></label>
130
+ <?php
131
+ }
132
+
133
+ /**
134
+ * Show email format radio
135
+ *
136
+ * @since 1.4
137
+ * @param array $args
138
+ */
139
+ function bnfw_email_format_radio( $args ) {
140
+ $email_format = get_option( 'bnfw_email_format', 'html' );
141
+ ?>
142
+ <label>
143
+ <input type="radio" value="html" name="bnfw_email_format" <?php checked( $email_format, 'html', true ); ?>><?php _e( 'HTML Formatting', 'bnfw' ); ?>
144
+ </label>
145
+ <br />
146
+ <label>
147
+ <input type="radio" value="text" name="bnfw_email_format" <?php checked( $email_format, 'text', true ); ?>><?php _e( 'Plain Text', 'bnfw' ); ?>
148
+ </label>
149
+ <p><i><?php echo $args[0]; ?></i></p>
150
+ <?php
151
+ }
includes/admin/class-bnfw-notification.php CHANGED
@@ -106,6 +106,7 @@ class BNFW_Notification {
106
  */
107
  public function remove_meta_boxes() {
108
  remove_meta_box( 'submitdiv', self::POST_TYPE, 'side' );
 
109
  }
110
 
111
  /**
@@ -235,15 +236,15 @@ class BNFW_Notification {
235
  <tr valign="top" id="user-password-msg">
236
  <td>&nbsp;</td>
237
  <td>
238
- <div style="background:#FFFFE1;padding:15px;">
239
- <p style="margin-top: 0;"><?php esc_html_e( "This notification doesn't support additional email fields or shortcodes in the subject line", 'bnfw' ); ?></p>
240
  </div>
241
  </td>
242
  </tr>
243
 
244
  <tr valign="top" id="email-formatting">
245
  <th>
246
- <?php esc_attr_e( 'Email formatting', 'bnfw' ); ?>
247
  </th>
248
  <td>
249
  <label style="margin-right: 20px;">
@@ -253,7 +254,7 @@ class BNFW_Notification {
253
 
254
  <label>
255
  <input type="radio" name="email-formatting" value="text" <?php checked( 'text', $setting['email-formatting'] ); ?>>
256
- <?php esc_html_e( 'Plain text', 'bnfw' ); ?>
257
  </label>
258
  </td>
259
  </tr>
@@ -284,7 +285,7 @@ class BNFW_Notification {
284
  </th>
285
 
286
  <td>
287
- <select multiple name="cc[]" class="select2" data-placeholder="Select Users" style="width:75%">
288
  <?php $this->render_users_dropdown( $setting['cc'] ); ?>
289
  </select>
290
  </td>
@@ -296,18 +297,28 @@ class BNFW_Notification {
296
  </th>
297
 
298
  <td>
299
- <select multiple name="bcc[]" class="select2" data-placeholder="Select Users" style="width:75%">
300
  <?php $this->render_users_dropdown( $setting['bcc'] ); ?>
301
  </select>
302
  </td>
303
  </tr>
304
 
 
 
 
 
 
 
 
 
 
 
305
  <tr valign="top" id="users">
306
  <th scope="row">
307
- <?php _e( 'Users', 'bnfw' ); ?>
308
  </th>
309
  <td>
310
- <select multiple name="users[]" class="select2" data-placeholder="Select Users" style="width:75%">
311
  <?php $this->render_users_dropdown( $setting['users'] ); ?>
312
  </select>
313
  </td>
@@ -318,7 +329,7 @@ class BNFW_Notification {
318
  <td>
319
  <label>
320
  <input type="checkbox" name="disable-current-user" value="true" <?php checked( 'true', $setting['disable-current-user'] ); ?>>
321
- <?php _e( 'Disable Notification for the User that triggered it', 'bnfw' ); ?>
322
  </label>
323
  </td>
324
  </tr>
@@ -388,6 +399,7 @@ class BNFW_Notification {
388
  wp_enqueue_style( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/3.5.2/select2.min.css', array(), '3.5.2' );
389
  wp_enqueue_script( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/3.5.2/select2.min.js', array( 'jquery' ), '3.5.2', true );
390
  wp_enqueue_script( 'bnfw', plugins_url( '../assets/js/bnfw.js', dirname( __FILE__ ) ), array( 'jquery' ), '0.1', true );
 
391
  }
392
  }
393
 
@@ -427,6 +439,7 @@ class BNFW_Notification {
427
  'disabled' => isset( $_POST['disabled'] ) ? sanitize_text_field( $_POST['disabled'] ) : 'false',
428
  'email-formatting' => isset( $_POST['email-formatting'] ) ? sanitize_text_field( $_POST['email-formatting'] ) : 'html',
429
  'disable-current-user' => isset( $_POST['disable-current-user'] ) ? sanitize_text_field( $_POST['disable-current-user'] ) : 'false',
 
430
  'users' => array(),
431
  );
432
 
@@ -512,10 +525,11 @@ class BNFW_Notification {
512
  'bcc' => array(),
513
  'users' => array(),
514
  'subject' => '',
515
- 'email-formatting' => 'html',
516
  'message' => '',
517
  'show-fields' => 'false',
518
  'disable-current-user' => 'false',
 
519
  'disabled' => 'false',
520
  );
521
 
@@ -676,7 +690,7 @@ class BNFW_Notification {
676
  $columns['type'] = __( 'Notification Type', 'bnfw' );
677
  $columns['disabled'] = __( 'Enabled?', 'bnfw' );
678
  $columns['subject'] = __( 'Subject', 'bnfw' );
679
- $columns['users'] = __( 'User Roles/Users', 'bnfw' );
680
 
681
  return $columns;
682
  }
@@ -695,7 +709,7 @@ class BNFW_Notification {
695
  switch ( $column ) {
696
  case 'disabled':
697
  if ( 'true' != $setting['disabled'] ) {
698
- printf( '<img src="%s" style="width:25px;">', plugins_url( '../assets/images/notification-enabled.png', dirname( __FILE__ ) ) );
699
  }
700
  break;
701
  case 'type':
106
  */
107
  public function remove_meta_boxes() {
108
  remove_meta_box( 'submitdiv', self::POST_TYPE, 'side' );
109
+ remove_meta_box( 'slugdiv', self::POST_TYPE, 'normal' );
110
  }
111
 
112
  /**
236
  <tr valign="top" id="user-password-msg">
237
  <td>&nbsp;</td>
238
  <td>
239
+ <div>
240
+ <p style="margin-top: 0;"><?php esc_html_e( "This notification doesn't support additional email fields or shortcodes in the subject line.", 'bnfw' ); ?></p>
241
  </div>
242
  </td>
243
  </tr>
244
 
245
  <tr valign="top" id="email-formatting">
246
  <th>
247
+ <?php esc_attr_e( 'Email Formatting', 'bnfw' ); ?>
248
  </th>
249
  <td>
250
  <label style="margin-right: 20px;">
254
 
255
  <label>
256
  <input type="radio" name="email-formatting" value="text" <?php checked( 'text', $setting['email-formatting'] ); ?>>
257
+ <?php esc_html_e( 'Plain Text', 'bnfw' ); ?>
258
  </label>
259
  </td>
260
  </tr>
285
  </th>
286
 
287
  <td>
288
+ <select multiple name="cc[]" class="select2" data-placeholder="Select User Roles / Users" style="width:75%">
289
  <?php $this->render_users_dropdown( $setting['cc'] ); ?>
290
  </select>
291
  </td>
297
  </th>
298
 
299
  <td>
300
+ <select multiple name="bcc[]" class="select2" data-placeholder="Select User Roles / Users" style="width:75%">
301
  <?php $this->render_users_dropdown( $setting['bcc'] ); ?>
302
  </select>
303
  </td>
304
  </tr>
305
 
306
+ <tr valign="top" id="post-author">
307
+ <th> </th>
308
+ <td>
309
+ <label>
310
+ <input type="checkbox" id="only-post-author" name="only-post-author" value="true" <?php checked( 'true', $setting['only-post-author'] ); ?>>
311
+ <?php _e( 'Send this notification to the Author only', 'bnfw' ); ?>
312
+ </label>
313
+ </td>
314
+ </tr>
315
+
316
  <tr valign="top" id="users">
317
  <th scope="row">
318
+ <?php _e( 'Send To', 'bnfw' ); ?>
319
  </th>
320
  <td>
321
+ <select multiple name="users[]" class="select2" data-placeholder="Select User Roles / Users" style="width:75%">
322
  <?php $this->render_users_dropdown( $setting['users'] ); ?>
323
  </select>
324
  </td>
329
  <td>
330
  <label>
331
  <input type="checkbox" name="disable-current-user" value="true" <?php checked( 'true', $setting['disable-current-user'] ); ?>>
332
+ <?php _e( 'Disable this Notification for the User that triggered it', 'bnfw' ); ?>
333
  </label>
334
  </td>
335
  </tr>
399
  wp_enqueue_style( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/3.5.2/select2.min.css', array(), '3.5.2' );
400
  wp_enqueue_script( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/3.5.2/select2.min.js', array( 'jquery' ), '3.5.2', true );
401
  wp_enqueue_script( 'bnfw', plugins_url( '../assets/js/bnfw.js', dirname( __FILE__ ) ), array( 'jquery' ), '0.1', true );
402
+ wp_enqueue_style( 'bnfw', plugins_url( '../assets/css/bnfw.css', dirname( __FILE__ ) ), array( 'dashicons' ), '0.1' );
403
  }
404
  }
405
 
439
  'disabled' => isset( $_POST['disabled'] ) ? sanitize_text_field( $_POST['disabled'] ) : 'false',
440
  'email-formatting' => isset( $_POST['email-formatting'] ) ? sanitize_text_field( $_POST['email-formatting'] ) : 'html',
441
  'disable-current-user' => isset( $_POST['disable-current-user'] ) ? sanitize_text_field( $_POST['disable-current-user'] ) : 'false',
442
+ 'only-post-author' => isset( $_POST['only-post-author'] ) ? sanitize_text_field( $_POST['only-post-author'] ) : 'false',
443
  'users' => array(),
444
  );
445
 
525
  'bcc' => array(),
526
  'users' => array(),
527
  'subject' => '',
528
+ 'email-formatting' => get_option( 'bnfw_email_format', 'html' ),
529
  'message' => '',
530
  'show-fields' => 'false',
531
  'disable-current-user' => 'false',
532
+ 'only-post-author' => 'false',
533
  'disabled' => 'false',
534
  );
535
 
690
  $columns['type'] = __( 'Notification Type', 'bnfw' );
691
  $columns['disabled'] = __( 'Enabled?', 'bnfw' );
692
  $columns['subject'] = __( 'Subject', 'bnfw' );
693
+ $columns['users'] = __( 'User Roles / Users', 'bnfw' );
694
 
695
  return $columns;
696
  }
709
  switch ( $column ) {
710
  case 'disabled':
711
  if ( 'true' != $setting['disabled'] ) {
712
+ printf('<span class="dashicons dashicons-yes"></span>');
713
  }
714
  break;
715
  case 'type':
includes/engine/class-bnfw-engine.php CHANGED
@@ -31,21 +31,25 @@ class BNFW_Engine {
31
  * Send the notification email.
32
  *
33
  * @since 1.0
34
- * @param unknown $setting
35
- * @param unknown $id
36
  */
37
  public function send_notification( $setting, $id ) {
38
  $subject = $this->handle_shortcodes( $setting['subject'], $setting['notification'], $id );
39
  $message = $this->handle_shortcodes( $setting['message'], $setting['notification'], $id );
40
- $emails = $this->get_emails( $setting );
41
  $headers = $this->get_headers( $emails );
42
 
43
  if ( 'html' == $setting['email-formatting'] ) {
44
  $headers[] = 'Content-type: text/html';
 
 
45
  }
46
 
47
- foreach ( $emails['to'] as $email ) {
48
- wp_mail( $email, stripslashes( $subject ), wpautop( $message ), $headers );
 
 
49
  }
50
  }
51
 
@@ -55,16 +59,19 @@ class BNFW_Engine {
55
  * @since 1.1
56
  * @param array $setting Notification setting
57
  * @param object $user User object
58
- * @param string $password Plain text password
59
  */
60
- public function send_registration_email( $setting, $user, $password = '' ) {
61
  $user_id = $user->ID;
62
 
63
  $subject = $this->handle_shortcodes( $setting['subject'], $setting['notification'], $user_id );
64
  $message = $this->handle_shortcodes( $setting['message'], $setting['notification'], $user_id );
65
 
66
- $subject = str_replace( '[password]', $password, $subject );
67
- $message = str_replace( '[password]', $password, $message );
 
 
 
68
 
69
  $subject = str_replace( '[login_url]', wp_login_url() , $subject );
70
  $message = str_replace( '[login_url]', wp_login_url(), $message );
@@ -337,9 +344,10 @@ class BNFW_Engine {
337
  *
338
  * @since 1.0
339
  * @param array $setting Notification settings
 
340
  * @return array Emails
341
  */
342
- private function get_emails( $setting ) {
343
  global $current_user;
344
 
345
  $emails = array();
@@ -351,8 +359,15 @@ class BNFW_Engine {
351
  }
352
  }
353
 
354
- if ( ! empty( $setting['users'] ) ) {
355
- $emails['to'] = $this->get_emails_from_users( $setting['users'], $exclude );
 
 
 
 
 
 
 
356
  }
357
 
358
  if ( 'true' == $setting['show-fields'] ) {
31
  * Send the notification email.
32
  *
33
  * @since 1.0
34
+ * @param array $setting
35
+ * @param int $id
36
  */
37
  public function send_notification( $setting, $id ) {
38
  $subject = $this->handle_shortcodes( $setting['subject'], $setting['notification'], $id );
39
  $message = $this->handle_shortcodes( $setting['message'], $setting['notification'], $id );
40
+ $emails = $this->get_emails( $setting, $id );
41
  $headers = $this->get_headers( $emails );
42
 
43
  if ( 'html' == $setting['email-formatting'] ) {
44
  $headers[] = 'Content-type: text/html';
45
+ } else {
46
+ $headers[] = 'Content-type: text/plain';
47
  }
48
 
49
+ if ( is_array( $emails['to'] ) ) {
50
+ foreach ( $emails['to'] as $email ) {
51
+ wp_mail( $email, stripslashes( $subject ), wpautop( $message ), $headers );
52
+ }
53
  }
54
  }
55
 
59
  * @since 1.1
60
  * @param array $setting Notification setting
61
  * @param object $user User object
62
+ * @param string $password_url Plain text password in WP < 4.3 and password url in WP > 4.3
63
  */
64
+ public function send_registration_email( $setting, $user, $password_url = '' ) {
65
  $user_id = $user->ID;
66
 
67
  $subject = $this->handle_shortcodes( $setting['subject'], $setting['notification'], $user_id );
68
  $message = $this->handle_shortcodes( $setting['message'], $setting['notification'], $user_id );
69
 
70
+ $subject = str_replace( '[password]', $password_url, $subject );
71
+ $message = str_replace( '[password]', $password_url, $message );
72
+
73
+ $subject = str_replace( '[password_url]', $password_url, $subject );
74
+ $message = str_replace( '[password_url]', $password_url, $message );
75
 
76
  $subject = str_replace( '[login_url]', wp_login_url() , $subject );
77
  $message = str_replace( '[login_url]', wp_login_url(), $message );
344
  *
345
  * @since 1.0
346
  * @param array $setting Notification settings
347
+ * @param int $id
348
  * @return array Emails
349
  */
350
+ private function get_emails( $setting, $id ) {
351
  global $current_user;
352
 
353
  $emails = array();
359
  }
360
  }
361
 
362
+ if ( 'true' === $setting['only-post-author'] ) {
363
+ $author = get_user_by( 'id', get_post_field( 'post_author', $id ) );
364
+ if ( false !== $author ) {
365
+ $emails['to'] = array( $author->user_email );
366
+ }
367
+ } else {
368
+ if ( ! empty( $setting['users'] ) ) {
369
+ $emails['to'] = $this->get_emails_from_users( $setting['users'], $exclude );
370
+ }
371
  }
372
 
373
  if ( 'true' == $setting['show-fields'] ) {
includes/overrides.php CHANGED
@@ -9,42 +9,100 @@
9
  *
10
  * A new user registration notification is also sent to admin email.
11
  *
12
- * @param int $user_id User ID.
13
- * @param string $plaintext_pass (optional) Optional. The user's plaintext password. Default empty.
 
14
  */
15
  if ( ! function_exists( 'wp_new_user_notification' ) ) {
16
- function wp_new_user_notification( $user_id, $plaintext_pass = '' ) {
17
- $bnfw = BNFW::factory();
18
- $user = get_userdata( $user_id );
19
 
20
- // The blogname option is escaped with esc_html on the way into the database in sanitize_option
21
- // we want to reverse this for the plain text arena of emails.
22
- $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
23
 
24
- if ( ! $bnfw->notifier->notification_exists( 'admin-user' ) ) {
25
- $message = sprintf( __( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n";
26
- $message .= sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
27
- $message .= sprintf( __( 'E-mail: %s' ), $user->user_email ) . "\r\n";
28
 
29
- @wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] New User Registration' ), $blogname ), $message );
30
- }
 
31
 
32
- if ( empty( $plaintext_pass ) ) {
33
- return;
34
- }
 
35
 
36
- if ( $bnfw->notifier->notification_exists( 'new-user' ) ) {
37
- $notifications = $bnfw->notifier->get_notifications( 'new-user' );
38
- foreach ( $notifications as $notification ) {
39
- $bnfw->engine->send_registration_email( $bnfw->notifier->read_settings( $notification->ID ), $user, $plaintext_pass );
40
- }
41
- } else {
42
- $message = sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n";
43
- $message .= sprintf( __( 'Password: %s' ), $plaintext_pass ) . "\r\n";
44
- $message .= wp_login_url() . "\r\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
- wp_mail( $user->user_email, sprintf( __( '[%s] Your username and password' ), $blogname ), $message );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
  }
49
- }
50
  ?>
9
  *
10
  * A new user registration notification is also sent to admin email.
11
  *
12
+ * @param int $user_id User ID.
13
+ * @param string $notify (optional) Optional. Whether admin and user should be notified ('both') or
14
+ * only the admin ('admin' or empty).
15
  */
16
  if ( ! function_exists( 'wp_new_user_notification' ) ) {
17
+ function wp_new_user_notification( $user_id, $notify = '' ) {
18
+ global $wp_version;
 
19
 
20
+ $bnfw = BNFW::factory();
21
+ $user = get_userdata( $user_id );
 
22
 
23
+ if ( version_compare( $wp_version, '4.3', '>=' ) ) {
24
+ // for WordPress 4.3 and above
25
+ global $wpdb;
 
26
 
27
+ // The blogname option is escaped with esc_html on the way into the database in sanitize_option
28
+ // we want to reverse this for the plain text arena of emails.
29
+ $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
30
 
31
+ if ( ! $bnfw->notifier->notification_exists( 'admin-user' ) ) {
32
+ $message = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
33
+ $message .= sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
34
+ $message .= sprintf(__('E-mail: %s'), $user->user_email) . "\r\n";
35
 
36
+ @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
37
+ }
38
+
39
+ if ( 'admin' === $notify || empty( $notify ) ) {
40
+ return;
41
+ }
42
+
43
+ // Generate something random for a password reset key.
44
+ $key = wp_generate_password( 20, false );
45
+
46
+ /** This action is documented in wp-login.php */
47
+ do_action( 'retrieve_password_key', $user->user_login, $key );
48
+
49
+ // Now insert the key, hashed, into the DB.
50
+ if ( empty( $wp_hasher ) ) {
51
+ require_once ABSPATH . WPINC . '/class-phpass.php';
52
+ $wp_hasher = new PasswordHash( 8, true );
53
+ }
54
+ $hashed = time() . ':' . $wp_hasher->HashPassword( $key );
55
+ $wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed ), array( 'user_login' => $user->user_login ) );
56
+
57
+ if ( $bnfw->notifier->notification_exists( 'new-user' ) ) {
58
+ $notifications = $bnfw->notifier->get_notifications( 'new-user' );
59
+ $password_url = network_site_url( "wp-login.php?action=rp&key=" . $key . "&login=" . rawurlencode( $user->user_login ), 'login' );
60
+ foreach ( $notifications as $notification ) {
61
+ $bnfw->engine->send_registration_email( $bnfw->notifier->read_settings( $notification->ID ), $user, $password_url );
62
+ }
63
+ } else {
64
+ $message = sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
65
+ $message .= __('To set your password, visit the following address:') . "\r\n\r\n";
66
+ $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user->user_login), 'login') . ">\r\n\r\n";
67
+
68
+ $message .= wp_login_url() . "\r\n";
69
 
70
+ wp_mail($user->user_email, sprintf(__('[%s] Your username and password info'), $blogname), $message);
71
+ }
72
+ } else {
73
+
74
+ // for WordPress below 4.3
75
+ $plaintext_pass = $notify;
76
+
77
+ // The blogname option is escaped with esc_html on the way into the database in sanitize_option
78
+ // we want to reverse this for the plain text arena of emails.
79
+ $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
80
+
81
+ if ( ! $bnfw->notifier->notification_exists( 'admin-user' ) ) {
82
+ $message = sprintf( __( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n";
83
+ $message .= sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
84
+ $message .= sprintf( __( 'E-mail: %s' ), $user->user_email ) . "\r\n";
85
+
86
+ @wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] New User Registration' ), $blogname ), $message );
87
+ }
88
+
89
+ if ( empty( $plaintext_pass ) ) {
90
+ return;
91
+ }
92
+
93
+ if ( $bnfw->notifier->notification_exists( 'new-user' ) ) {
94
+ $notifications = $bnfw->notifier->get_notifications( 'new-user' );
95
+ foreach ( $notifications as $notification ) {
96
+ $bnfw->engine->send_registration_email( $bnfw->notifier->read_settings( $notification->ID ), $user, $plaintext_pass );
97
+ }
98
+ } else {
99
+ $message = sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n";
100
+ $message .= sprintf( __( 'Password: %s' ), $plaintext_pass ) . "\r\n";
101
+ $message .= wp_login_url() . "\r\n";
102
+
103
+ wp_mail( $user->user_email, sprintf( __( '[%s] Your username and password' ), $blogname ), $message );
104
+ }
105
+ }
106
  }
107
  }
 
108
  ?>
languages/bnfw.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Better Notifications for WordPress package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Better Notifications for WordPress 1.3\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/bnfw\n"
7
- "POT-Creation-Date: 2015-07-02 17:40:26+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -13,7 +13,7 @@ msgstr ""
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
  #: includes/admin/bnfw-settings.php:14
16
- #: includes/admin/class-bnfw-notification.php:119
17
  msgid "Notification Settings"
18
  msgstr ""
19
 
@@ -25,14 +25,35 @@ msgstr ""
25
  msgid "BNFW Settings"
26
  msgstr ""
27
 
28
- #: includes/admin/bnfw-settings.php:72
29
  msgid "Suppress SPAM comment notification"
30
  msgstr ""
31
 
32
- #: includes/admin/bnfw-settings.php:77
33
  msgid "Don't send notifications for comments marked as SPAM by Akismet"
34
  msgstr ""
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  #: includes/admin/class-bnfw-notification.php:45
37
  #: includes/admin/class-bnfw-notification.php:48
38
  #: includes/admin/class-bnfw-notification.php:49
@@ -79,271 +100,267 @@ msgstr ""
79
  msgid "All Notifications"
80
  msgstr ""
81
 
82
- #: includes/admin/class-bnfw-notification.php:127
83
  msgid "Save Notification"
84
  msgstr ""
85
 
86
- #: includes/admin/class-bnfw-notification.php:155
87
  msgid "Notification For"
88
  msgstr ""
89
 
90
- #: includes/admin/class-bnfw-notification.php:160
91
  msgid "New Comment / Awaiting Moderation"
92
  msgstr ""
93
 
94
- #: includes/admin/class-bnfw-notification.php:161
95
- #: includes/admin/class-bnfw-notification.php:755
96
  msgid "New Trackback"
97
  msgstr ""
98
 
99
- #: includes/admin/class-bnfw-notification.php:162
100
- #: includes/admin/class-bnfw-notification.php:758
101
  msgid "New Pingback"
102
  msgstr ""
103
 
104
- #: includes/admin/class-bnfw-notification.php:163
105
- #: includes/admin/class-bnfw-notification.php:767
106
  msgid "Lost Password - For Admin"
107
  msgstr ""
108
 
109
- #: includes/admin/class-bnfw-notification.php:164
110
  msgid "New User Registration - For Admin"
111
  msgstr ""
112
 
113
- #: includes/admin/class-bnfw-notification.php:167
114
- #: includes/admin/class-bnfw-notification.php:764
115
  msgid "Lost Password - For User"
116
  msgstr ""
117
 
118
- #: includes/admin/class-bnfw-notification.php:168
119
  msgid "New User Registration - For User"
120
  msgstr ""
121
 
122
- #: includes/admin/class-bnfw-notification.php:169
123
  msgid "New User - Welcome Email"
124
  msgstr ""
125
 
126
- #: includes/admin/class-bnfw-notification.php:170
127
- #: includes/admin/class-bnfw-notification.php:761
128
  msgid "Comment Reply"
129
  msgstr ""
130
 
131
- #: includes/admin/class-bnfw-notification.php:173
132
- #: includes/admin/class-bnfw-notification.php:779
133
  msgid "New Post Published"
134
  msgstr ""
135
 
136
- #: includes/admin/class-bnfw-notification.php:174
137
- #: includes/admin/class-bnfw-notification.php:782
138
  msgid "Post Updated"
139
  msgstr ""
140
 
141
- #: includes/admin/class-bnfw-notification.php:175
142
- #: includes/admin/class-bnfw-notification.php:785
143
  msgid "Post Pending Review"
144
  msgstr ""
145
 
146
- #: includes/admin/class-bnfw-notification.php:176
147
- #: includes/admin/class-bnfw-notification.php:788
148
  msgid "Post Scheduled"
149
  msgstr ""
150
 
151
- #: includes/admin/class-bnfw-notification.php:177
152
- #: includes/admin/class-bnfw-notification.php:791
153
  msgid "New Category"
154
  msgstr ""
155
 
156
- #: includes/admin/class-bnfw-notification.php:178
157
- #: includes/admin/class-bnfw-notification.php:794
158
  msgid "New Tag"
159
  msgstr ""
160
 
161
- #: includes/admin/class-bnfw-notification.php:181
162
  msgid "New Page Published"
163
  msgstr ""
164
 
165
- #: includes/admin/class-bnfw-notification.php:182
166
  msgid "Page Updated"
167
  msgstr ""
168
 
169
- #: includes/admin/class-bnfw-notification.php:183
170
  msgid "Page Pending Review"
171
  msgstr ""
172
 
173
- #: includes/admin/class-bnfw-notification.php:184
174
  msgid "Page Scheduled"
175
  msgstr ""
176
 
177
- #: includes/admin/class-bnfw-notification.php:185
178
  msgid "Page - New Comment"
179
  msgstr ""
180
 
181
- #: includes/admin/class-bnfw-notification.php:199
182
  msgid "Custom Post Type"
183
  msgstr ""
184
 
185
- #: includes/admin/class-bnfw-notification.php:200
186
- #: includes/admin/class-bnfw-notification.php:807
187
  msgid "New "
188
  msgstr ""
189
 
190
- #: includes/admin/class-bnfw-notification.php:201
191
  msgid "Update "
192
  msgstr ""
193
 
194
- #: includes/admin/class-bnfw-notification.php:202
195
  msgid "Pending Review"
196
  msgstr ""
197
 
198
- #: includes/admin/class-bnfw-notification.php:203
199
  msgid "Scheduled"
200
  msgstr ""
201
 
202
- #: includes/admin/class-bnfw-notification.php:204
203
- #: includes/admin/class-bnfw-notification.php:752
204
  msgid "New Comment"
205
  msgstr ""
206
 
207
- #: includes/admin/class-bnfw-notification.php:218
208
  msgid "Custom Taxonomy"
209
  msgstr ""
210
 
211
- #: includes/admin/class-bnfw-notification.php:223
212
  msgid "New"
213
  msgstr ""
214
 
215
- #: includes/admin/class-bnfw-notification.php:239
216
  msgid ""
217
  "This notification doesn't support additional email fields or shortcodes in "
218
- "the subject line"
219
  msgstr ""
220
 
221
- #: includes/admin/class-bnfw-notification.php:246
222
- msgid "Email formatting"
223
  msgstr ""
224
 
225
- #: includes/admin/class-bnfw-notification.php:251
226
- msgid "HTML Formatting"
227
- msgstr ""
228
-
229
- #: includes/admin/class-bnfw-notification.php:256
230
- msgid "Plain text"
231
- msgstr ""
232
-
233
- #: includes/admin/class-bnfw-notification.php:263 includes/tmp.php:3
234
  msgid "Additional Email Fields"
235
  msgstr ""
236
 
237
- #: includes/admin/class-bnfw-notification.php:267 includes/tmp.php:7
238
  msgid "Show additional email fields"
239
  msgstr ""
240
 
241
- #: includes/admin/class-bnfw-notification.php:273 includes/tmp.php:13
242
  msgid "From Name and Email"
243
  msgstr ""
244
 
245
- #: includes/admin/class-bnfw-notification.php:283 includes/tmp.php:23
246
  msgid "CC"
247
  msgstr ""
248
 
249
- #: includes/admin/class-bnfw-notification.php:295 includes/tmp.php:34
250
  msgid "BCC"
251
  msgstr ""
252
 
253
- #: includes/admin/class-bnfw-notification.php:307
254
- msgid "Users"
 
 
 
 
255
  msgstr ""
256
 
257
- #: includes/admin/class-bnfw-notification.php:321
258
- msgid "Disable Notification for the User that triggered it"
259
  msgstr ""
260
 
261
- #: includes/admin/class-bnfw-notification.php:328
262
- #: includes/admin/class-bnfw-notification.php:678
263
  msgid "Subject"
264
  msgstr ""
265
 
266
- #: includes/admin/class-bnfw-notification.php:337
267
  msgid "Message Body"
268
  msgstr ""
269
 
270
- #: includes/admin/class-bnfw-notification.php:341
271
  msgid ""
272
  "Looking for help with shortcodes? Click here to see which ones you can use "
273
  "with the selected notification."
274
  msgstr ""
275
 
276
- #: includes/admin/class-bnfw-notification.php:477
277
  msgid "Test Notification Sent."
278
  msgstr ""
279
 
280
- #: includes/admin/class-bnfw-notification.php:553
281
  msgid "Notification saved."
282
  msgstr ""
283
 
284
- #: includes/admin/class-bnfw-notification.php:571
285
- #: includes/admin/class-bnfw-notification.php:607
286
- #: includes/admin/class-bnfw-notification.php:608
287
  msgid "Save"
288
  msgstr ""
289
 
290
- #: includes/admin/class-bnfw-notification.php:581
291
  msgid "Disable Notification"
292
  msgstr ""
293
 
294
- #: includes/admin/class-bnfw-notification.php:587
295
  msgid "Send Me a Test Email"
296
  msgstr ""
297
 
298
- #: includes/admin/class-bnfw-notification.php:597
299
  msgid "Delete Permanently"
300
  msgstr ""
301
 
302
- #: includes/admin/class-bnfw-notification.php:599
303
  msgid "Move to Trash"
304
  msgstr ""
305
 
306
- #: includes/admin/class-bnfw-notification.php:676
307
  msgid "Notification Type"
308
  msgstr ""
309
 
310
- #: includes/admin/class-bnfw-notification.php:677
311
  msgid "Enabled?"
312
  msgstr ""
313
 
314
- #: includes/admin/class-bnfw-notification.php:679
315
- msgid "User Roles/Users"
316
  msgstr ""
317
 
318
- #: includes/admin/class-bnfw-notification.php:770
319
  msgid "User Registration - For User"
320
  msgstr ""
321
 
322
- #: includes/admin/class-bnfw-notification.php:773
323
  msgid "New User - Welcome email"
324
  msgstr ""
325
 
326
- #: includes/admin/class-bnfw-notification.php:776
327
  msgid "User Registration - For Admin"
328
  msgstr ""
329
 
330
- #: includes/admin/class-bnfw-notification.php:810
331
  msgid "Updated "
332
  msgstr ""
333
 
334
- #: includes/admin/class-bnfw-notification.php:813
335
  msgid " Pending Review"
336
  msgstr ""
337
 
338
- #: includes/admin/class-bnfw-notification.php:816
339
  msgid " Scheduled"
340
  msgstr ""
341
 
342
- #: includes/admin/class-bnfw-notification.php:819
343
  msgid " Comment"
344
  msgstr ""
345
 
346
- #: includes/admin/class-bnfw-notification.php:822
347
  msgid "New term in "
348
  msgstr ""
349
 
2
  # This file is distributed under the same license as the Better Notifications for WordPress package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Better Notifications for WordPress 1.3.3\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bnfw\n"
7
+ "POT-Creation-Date: 2015-08-11 05:30:23+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
  #: includes/admin/bnfw-settings.php:14
16
+ #: includes/admin/class-bnfw-notification.php:120
17
  msgid "Notification Settings"
18
  msgstr ""
19
 
25
  msgid "BNFW Settings"
26
  msgstr ""
27
 
28
+ #: includes/admin/bnfw-settings.php:77
29
  msgid "Suppress SPAM comment notification"
30
  msgstr ""
31
 
32
+ #: includes/admin/bnfw-settings.php:82
33
  msgid "Don't send notifications for comments marked as SPAM by Akismet"
34
  msgstr ""
35
 
36
+ #: includes/admin/bnfw-settings.php:95
37
+ msgid "Default Email Format"
38
+ msgstr ""
39
+
40
+ #: includes/admin/bnfw-settings.php:100
41
+ msgid ""
42
+ "This will apply to all emails sent out via WordPress, even those from other "
43
+ "plugins. For more details, please see the <a href=\"https://wordpress.org/"
44
+ "plugins/bnfw/faq/\" target=\"_blank\">FAQ</a>."
45
+ msgstr ""
46
+
47
+ #: includes/admin/bnfw-settings.php:143
48
+ #: includes/admin/class-bnfw-notification.php:252
49
+ msgid "HTML Formatting"
50
+ msgstr ""
51
+
52
+ #: includes/admin/bnfw-settings.php:147
53
+ #: includes/admin/class-bnfw-notification.php:257
54
+ msgid "Plain Text"
55
+ msgstr ""
56
+
57
  #: includes/admin/class-bnfw-notification.php:45
58
  #: includes/admin/class-bnfw-notification.php:48
59
  #: includes/admin/class-bnfw-notification.php:49
100
  msgid "All Notifications"
101
  msgstr ""
102
 
103
+ #: includes/admin/class-bnfw-notification.php:128
104
  msgid "Save Notification"
105
  msgstr ""
106
 
107
+ #: includes/admin/class-bnfw-notification.php:156
108
  msgid "Notification For"
109
  msgstr ""
110
 
111
+ #: includes/admin/class-bnfw-notification.php:161
112
  msgid "New Comment / Awaiting Moderation"
113
  msgstr ""
114
 
115
+ #: includes/admin/class-bnfw-notification.php:162
116
+ #: includes/admin/class-bnfw-notification.php:769
117
  msgid "New Trackback"
118
  msgstr ""
119
 
120
+ #: includes/admin/class-bnfw-notification.php:163
121
+ #: includes/admin/class-bnfw-notification.php:772
122
  msgid "New Pingback"
123
  msgstr ""
124
 
125
+ #: includes/admin/class-bnfw-notification.php:164
126
+ #: includes/admin/class-bnfw-notification.php:781
127
  msgid "Lost Password - For Admin"
128
  msgstr ""
129
 
130
+ #: includes/admin/class-bnfw-notification.php:165
131
  msgid "New User Registration - For Admin"
132
  msgstr ""
133
 
134
+ #: includes/admin/class-bnfw-notification.php:168
135
+ #: includes/admin/class-bnfw-notification.php:778
136
  msgid "Lost Password - For User"
137
  msgstr ""
138
 
139
+ #: includes/admin/class-bnfw-notification.php:169
140
  msgid "New User Registration - For User"
141
  msgstr ""
142
 
143
+ #: includes/admin/class-bnfw-notification.php:170
144
  msgid "New User - Welcome Email"
145
  msgstr ""
146
 
147
+ #: includes/admin/class-bnfw-notification.php:171
148
+ #: includes/admin/class-bnfw-notification.php:775
149
  msgid "Comment Reply"
150
  msgstr ""
151
 
152
+ #: includes/admin/class-bnfw-notification.php:174
153
+ #: includes/admin/class-bnfw-notification.php:793
154
  msgid "New Post Published"
155
  msgstr ""
156
 
157
+ #: includes/admin/class-bnfw-notification.php:175
158
+ #: includes/admin/class-bnfw-notification.php:796
159
  msgid "Post Updated"
160
  msgstr ""
161
 
162
+ #: includes/admin/class-bnfw-notification.php:176
163
+ #: includes/admin/class-bnfw-notification.php:799
164
  msgid "Post Pending Review"
165
  msgstr ""
166
 
167
+ #: includes/admin/class-bnfw-notification.php:177
168
+ #: includes/admin/class-bnfw-notification.php:802
169
  msgid "Post Scheduled"
170
  msgstr ""
171
 
172
+ #: includes/admin/class-bnfw-notification.php:178
173
+ #: includes/admin/class-bnfw-notification.php:805
174
  msgid "New Category"
175
  msgstr ""
176
 
177
+ #: includes/admin/class-bnfw-notification.php:179
178
+ #: includes/admin/class-bnfw-notification.php:808
179
  msgid "New Tag"
180
  msgstr ""
181
 
182
+ #: includes/admin/class-bnfw-notification.php:182
183
  msgid "New Page Published"
184
  msgstr ""
185
 
186
+ #: includes/admin/class-bnfw-notification.php:183
187
  msgid "Page Updated"
188
  msgstr ""
189
 
190
+ #: includes/admin/class-bnfw-notification.php:184
191
  msgid "Page Pending Review"
192
  msgstr ""
193
 
194
+ #: includes/admin/class-bnfw-notification.php:185
195
  msgid "Page Scheduled"
196
  msgstr ""
197
 
198
+ #: includes/admin/class-bnfw-notification.php:186
199
  msgid "Page - New Comment"
200
  msgstr ""
201
 
202
+ #: includes/admin/class-bnfw-notification.php:200
203
  msgid "Custom Post Type"
204
  msgstr ""
205
 
206
+ #: includes/admin/class-bnfw-notification.php:201
207
+ #: includes/admin/class-bnfw-notification.php:821
208
  msgid "New "
209
  msgstr ""
210
 
211
+ #: includes/admin/class-bnfw-notification.php:202
212
  msgid "Update "
213
  msgstr ""
214
 
215
+ #: includes/admin/class-bnfw-notification.php:203
216
  msgid "Pending Review"
217
  msgstr ""
218
 
219
+ #: includes/admin/class-bnfw-notification.php:204
220
  msgid "Scheduled"
221
  msgstr ""
222
 
223
+ #: includes/admin/class-bnfw-notification.php:205
224
+ #: includes/admin/class-bnfw-notification.php:766
225
  msgid "New Comment"
226
  msgstr ""
227
 
228
+ #: includes/admin/class-bnfw-notification.php:219
229
  msgid "Custom Taxonomy"
230
  msgstr ""
231
 
232
+ #: includes/admin/class-bnfw-notification.php:224
233
  msgid "New"
234
  msgstr ""
235
 
236
+ #: includes/admin/class-bnfw-notification.php:240
237
  msgid ""
238
  "This notification doesn't support additional email fields or shortcodes in "
239
+ "the subject line."
240
  msgstr ""
241
 
242
+ #: includes/admin/class-bnfw-notification.php:247
243
+ msgid "Email Formatting"
244
  msgstr ""
245
 
246
+ #: includes/admin/class-bnfw-notification.php:264 includes/tmp.php:3
 
 
 
 
 
 
 
 
247
  msgid "Additional Email Fields"
248
  msgstr ""
249
 
250
+ #: includes/admin/class-bnfw-notification.php:268 includes/tmp.php:7
251
  msgid "Show additional email fields"
252
  msgstr ""
253
 
254
+ #: includes/admin/class-bnfw-notification.php:274 includes/tmp.php:13
255
  msgid "From Name and Email"
256
  msgstr ""
257
 
258
+ #: includes/admin/class-bnfw-notification.php:284 includes/tmp.php:23
259
  msgid "CC"
260
  msgstr ""
261
 
262
+ #: includes/admin/class-bnfw-notification.php:296 includes/tmp.php:34
263
  msgid "BCC"
264
  msgstr ""
265
 
266
+ #: includes/admin/class-bnfw-notification.php:311
267
+ msgid "Send this notification to the Post Author only"
268
+ msgstr ""
269
+
270
+ #: includes/admin/class-bnfw-notification.php:318
271
+ msgid "Send To"
272
  msgstr ""
273
 
274
+ #: includes/admin/class-bnfw-notification.php:332
275
+ msgid "Disable this Notification for the User that triggered it"
276
  msgstr ""
277
 
278
+ #: includes/admin/class-bnfw-notification.php:339
279
+ #: includes/admin/class-bnfw-notification.php:692
280
  msgid "Subject"
281
  msgstr ""
282
 
283
+ #: includes/admin/class-bnfw-notification.php:348
284
  msgid "Message Body"
285
  msgstr ""
286
 
287
+ #: includes/admin/class-bnfw-notification.php:352
288
  msgid ""
289
  "Looking for help with shortcodes? Click here to see which ones you can use "
290
  "with the selected notification."
291
  msgstr ""
292
 
293
+ #: includes/admin/class-bnfw-notification.php:490
294
  msgid "Test Notification Sent."
295
  msgstr ""
296
 
297
+ #: includes/admin/class-bnfw-notification.php:567
298
  msgid "Notification saved."
299
  msgstr ""
300
 
301
+ #: includes/admin/class-bnfw-notification.php:585
302
+ #: includes/admin/class-bnfw-notification.php:621
303
+ #: includes/admin/class-bnfw-notification.php:622
304
  msgid "Save"
305
  msgstr ""
306
 
307
+ #: includes/admin/class-bnfw-notification.php:595
308
  msgid "Disable Notification"
309
  msgstr ""
310
 
311
+ #: includes/admin/class-bnfw-notification.php:601
312
  msgid "Send Me a Test Email"
313
  msgstr ""
314
 
315
+ #: includes/admin/class-bnfw-notification.php:611
316
  msgid "Delete Permanently"
317
  msgstr ""
318
 
319
+ #: includes/admin/class-bnfw-notification.php:613
320
  msgid "Move to Trash"
321
  msgstr ""
322
 
323
+ #: includes/admin/class-bnfw-notification.php:690
324
  msgid "Notification Type"
325
  msgstr ""
326
 
327
+ #: includes/admin/class-bnfw-notification.php:691
328
  msgid "Enabled?"
329
  msgstr ""
330
 
331
+ #: includes/admin/class-bnfw-notification.php:693
332
+ msgid "User Roles / Users"
333
  msgstr ""
334
 
335
+ #: includes/admin/class-bnfw-notification.php:784
336
  msgid "User Registration - For User"
337
  msgstr ""
338
 
339
+ #: includes/admin/class-bnfw-notification.php:787
340
  msgid "New User - Welcome email"
341
  msgstr ""
342
 
343
+ #: includes/admin/class-bnfw-notification.php:790
344
  msgid "User Registration - For Admin"
345
  msgstr ""
346
 
347
+ #: includes/admin/class-bnfw-notification.php:824
348
  msgid "Updated "
349
  msgstr ""
350
 
351
+ #: includes/admin/class-bnfw-notification.php:827
352
  msgid " Pending Review"
353
  msgstr ""
354
 
355
+ #: includes/admin/class-bnfw-notification.php:830
356
  msgid " Scheduled"
357
  msgstr ""
358
 
359
+ #: includes/admin/class-bnfw-notification.php:833
360
  msgid " Comment"
361
  msgstr ""
362
 
363
+ #: includes/admin/class-bnfw-notification.php:836
364
  msgid "New term in "
365
  msgstr ""
366