Postie - Version 1.9.35

Version Description

(2019-05-31) = * Allow for a single admin when sending post confirmation emails

Download this release

Release Info

Developer WayneAllen
Plugin Icon 128x128 Postie
Version 1.9.35
Comparing to
See all releases

Code changes from version 1.9.34 to 1.9.35

config_form_message.php CHANGED
@@ -137,25 +137,17 @@
137
  echo PostieAdmin::boolean_select_html(__("Filter newlines", 'postie'), "postie-settings[filternewlines]", $filternewlines, __("Whether to strip newlines from plain text. Set to no if using markdown or textitle syntax", 'postie'));
138
  echo PostieAdmin::boolean_select_html(__("Replace newline characters with html line breaks (<br />)", 'postie'), "postie-settings[convertnewline]", $convertnewline, __("Filter newlines must be turned on for this option to take effect", 'postie'));
139
  echo PostieAdmin::boolean_select_html(__("Return rejected mail to sender", 'postie'), "postie-settings[return_to_sender]", $return_to_sender);
140
- ?>
141
- <tr>
142
- <th>
143
- <?php _e("Send post confirmation email to", 'postie') ?>:
144
- </th>
145
- <td>
146
- <select name='postie-settings[confirmation_email]' id='postie-settings-confirmation_email'>
147
- <option value="sender" <?php echo($confirmation_email == "sender") ? "selected" : "" ?>><?php _e('sender', 'postie') ?></option>
148
- <option value="admin" <?php echo ($confirmation_email == "admin") ? "selected" : "" ?>><?php _e('administrator(s)', 'postie') ?></option>
149
- <option value="both" <?php echo ($confirmation_email == "both") ? "selected" : "" ?>><?php _e('sender and administrator(s)', 'postie') ?></option>
150
- <option value="" <?php echo ($confirmation_email == "") ? "selected" : "" ?>><?php _e('nobody', 'postie') ?></option>
151
- </select>
152
- </td>
153
- </tr>
154
 
155
- <?php
 
 
 
 
 
 
156
  echo PostieAdmin::boolean_select_html(__("Automatically convert urls to links", 'postie'), "postie-settings[converturls]", $converturls);
 
 
157
  ?>
158
- <?php echo PostieAdmin::boolean_select_html(__("Drop The Signature From Mail", 'postie'), "postie-settings[drop_signature]", $drop_signature); ?>
159
- <?php echo PostieAdmin::textarea_html(__("Signature Patterns", 'postie'), "postie-settings[sig_pattern_list]", $sig_pattern_list, __("Put each pattern on a separate line. Patterns are <a href='http://regex101.com/' target='_blank'>regular expressions</a> and are put inside '/^{pattern}\s?$/miu'. For HTML content the inner text of each element is evaluated against the pattern. E.g for &lt;p&gt;some test&lt;/p&gt;&lt;p&gt;-- &lt;br&gt;signature&lt;/p&gt; Postie will evaluate 'some text', '-- ' and 'signature' against the pattern(s) and the first time it find a match it will assume that is the signature and remove it and anything below it from the post.", 'postie')); ?>
160
  </table>
161
  </div>
137
  echo PostieAdmin::boolean_select_html(__("Filter newlines", 'postie'), "postie-settings[filternewlines]", $filternewlines, __("Whether to strip newlines from plain text. Set to no if using markdown or textitle syntax", 'postie'));
138
  echo PostieAdmin::boolean_select_html(__("Replace newline characters with html line breaks (&lt;br /&gt;)", 'postie'), "postie-settings[convertnewline]", $convertnewline, __("Filter newlines must be turned on for this option to take effect", 'postie'));
139
  echo PostieAdmin::boolean_select_html(__("Return rejected mail to sender", 'postie'), "postie-settings[return_to_sender]", $return_to_sender);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
 
141
+ $confirmation_options = array('sender' => 'sender', 'admin' => 'administrator(s)', 'both' => 'both', '' => 'nobody');
142
+ foreach (get_users(array('role' => 'administrator')) as $user) {
143
+ if (!array_key_exists($user->user_login, $confirmation_options)) {
144
+ $confirmation_options[$user->user_login] = $user->user_email;
145
+ }
146
+ }
147
+ echo PostieAdmin::select_html2(__('Send post confirmation email to', 'postie'), 'postie-settings[confirmation_email]', $confirmation_email, $confirmation_options);
148
  echo PostieAdmin::boolean_select_html(__("Automatically convert urls to links", 'postie'), "postie-settings[converturls]", $converturls);
149
+ echo PostieAdmin::boolean_select_html(__("Drop The Signature From Mail", 'postie'), "postie-settings[drop_signature]", $drop_signature);
150
+ echo PostieAdmin::textarea_html(__("Signature Patterns", 'postie'), "postie-settings[sig_pattern_list]", $sig_pattern_list, __("Put each pattern on a separate line. Patterns are <a href='http://regex101.com/' target='_blank'>regular expressions</a> and are put inside '/^{pattern}\s?$/miu'. For HTML content the inner text of each element is evaluated against the pattern. E.g for &lt;p&gt;some test&lt;/p&gt;&lt;p&gt;-- &lt;br&gt;signature&lt;/p&gt; Postie will evaluate 'some text', '-- ' and 'signature' against the pattern(s) and the first time it find a match it will assume that is the signature and remove it and anything below it from the post.", 'postie'));
151
  ?>
 
 
152
  </table>
153
  </div>
docs/Changes.txt CHANGED
@@ -35,6 +35,9 @@ All script, style and body tags are stripped from html emails.
35
  Attachments are now processed in the order they were attached.
36
 
37
  == CHANGELOG ==
 
 
 
38
  = 1.9.34 (2019-05-15) =
39
  * Workaround for WP bug #39521 to correctly set image caption from image metadata
40
 
35
  Attachments are now processed in the order they were attached.
36
 
37
  == CHANGELOG ==
38
+ = 1.9.35 (2019-05-31) =
39
+ * Allow for a single admin when sending post confirmation emails
40
+
41
  = 1.9.34 (2019-05-15) =
42
  * Workaround for WP bug #39521 to correctly set image caption from image metadata
43
 
docs/Postie.txt CHANGED
@@ -7,7 +7,7 @@ Tags: e-mail, email, post-by-email
7
  Requires PHP: 5.3
8
  Requires at least: 4.0
9
  Tested up to: 5.2
10
- Stable tag: 1.9.34
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
7
  Requires PHP: 5.3
8
  Requires at least: 4.0
9
  Tested up to: 5.2
10
+ Stable tag: 1.9.35
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
postie-admin.class.php CHANGED
@@ -72,4 +72,22 @@ class PostieAdmin {
72
  return $html;
73
  }
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  }
72
  return $html;
73
  }
74
 
75
+ static function select_html2($label, $id, $current_value, $options, $recommendation = NULL) {
76
+ DebugDump($options);
77
+ $html = "<tr>
78
+ <th scope='row'><label for='$id'>$label</label></th>\n";
79
+
80
+ $html .= "<td><select name='$id' id='$id'>\n";
81
+ foreach ($options as $key => $value) {
82
+ $html .= "<option value='$key' " . ($key == $current_value ? "selected='selected'" : "") . ">" . __($value, 'postie') . "</option>\n";
83
+ }
84
+ $html .= '</select>';
85
+ if (!empty($recommendation)) {
86
+ $html .= '<p class = "description">' . $recommendation . '</p>';
87
+ }
88
+ $html .= "</td>\n</tr>\n";
89
+
90
+ return $html;
91
+ }
92
+
93
  }
postie.class.php CHANGED
@@ -1282,14 +1282,19 @@ class Postie {
1282
  $postid = $this->save_post($details, $is_reply);
1283
 
1284
  $recipients = array();
1285
- if ($config['confirmation_email'] == 'sender' || $config['confirmation_email'] == 'both') {
 
1286
  $recipients[] = $details['email_author'];
1287
  }
1288
- if ($config['confirmation_email'] == 'admin' || $config['confirmation_email'] == 'both') {
1289
  foreach (get_users(array('role' => 'administrator', 'blog_id' => get_current_blog_id())) as $user) {
1290
  $recipients[] = $user->user_email;
1291
  }
1292
  }
 
 
 
 
1293
 
1294
  DebugEcho("post_email: sending notifications");
1295
  $this->email_notify($mimeDecodedEmail, $recipients, $postid);
1282
  $postid = $this->save_post($details, $is_reply);
1283
 
1284
  $recipients = array();
1285
+ $dest = $config['confirmation_email'];
1286
+ if ($dest == 'sender' || $dest == 'both') {
1287
  $recipients[] = $details['email_author'];
1288
  }
1289
+ if ($dest == 'admin' || $dest == 'both') {
1290
  foreach (get_users(array('role' => 'administrator', 'blog_id' => get_current_blog_id())) as $user) {
1291
  $recipients[] = $user->user_email;
1292
  }
1293
  }
1294
+ if (!($dest == 'admin' || $dest == 'sender' || $dest == 'both' || $dest == '')) {
1295
+ $user = get_user_by('login', $dest);
1296
+ $recipients[] = $user->user_email;
1297
+ }
1298
 
1299
  DebugEcho("post_email: sending notifications");
1300
  $this->email_notify($mimeDecodedEmail, $recipients, $postid);
postie.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Significantly upgrades the Post by Email features of WordPress.
7
- Version: 1.9.34
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
@@ -28,14 +28,14 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 2088761 2019-05-16 02:59:09Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
- define('POSTIE_VERSION', '1.9.34');
39
  define('POSTIE_ROOT', dirname(__FILE__));
40
  define('POSTIE_URL', WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
41
 
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Significantly upgrades the Post by Email features of WordPress.
7
+ Version: 1.9.35
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL3
28
  */
29
 
30
  /*
31
+ $Id: postie.php 2098913 2019-05-31 23:55:28Z WayneAllen $
32
  */
33
 
34
  if (!defined('WPINC')) {
35
  die; // Exit if accessed directly
36
  }
37
 
38
+ define('POSTIE_VERSION', '1.9.35');
39
  define('POSTIE_ROOT', dirname(__FILE__));
40
  define('POSTIE_URL', WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
41
 
readme.txt CHANGED
@@ -7,7 +7,7 @@ Tags: e-mail, email, post-by-email
7
  Requires PHP: 5.3
8
  Requires at least: 4.0
9
  Tested up to: 5.2
10
- Stable tag: 1.9.34
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -107,6 +107,9 @@ All script, style and body tags are stripped from html emails.
107
  Attachments are now processed in the order they were attached.
108
 
109
  == CHANGELOG ==
 
 
 
110
  = 1.9.34 (2019-05-15) =
111
  * Workaround for WP bug #39521 to correctly set image caption from image metadata
112
 
7
  Requires PHP: 5.3
8
  Requires at least: 4.0
9
  Tested up to: 5.2
10
+ Stable tag: 1.9.35
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
107
  Attachments are now processed in the order they were attached.
108
 
109
  == CHANGELOG ==
110
+ = 1.9.35 (2019-05-31) =
111
+ * Allow for a single admin when sending post confirmation emails
112
+
113
  = 1.9.34 (2019-05-15) =
114
  * Workaround for WP bug #39521 to correctly set image caption from image metadata
115