Newsletter - Version 4.5.7

Version Description

  • Fixed the total sent email in dashboard
  • Fixed the total sent number on newsletter list when an already sent newsletter is edited
  • Removed the save button on sent newsletter
  • Code cleanup
  • Service message for stats panel of draft newsletters
Download this release

Release Info

Developer satollo
Plugin Icon 128x128 Newsletter
Version 4.5.7
Comparing to
See all releases

Code changes from version 4.5.6 to 4.5.7

emails/cpreview.php CHANGED
@@ -108,19 +108,26 @@ if ($controls->is_action('test') || $controls->is_action('save') || $controls->i
108
  }
109
  }
110
 
111
- $sex = $controls->data['sex'];
112
- if (is_array($sex)) {
113
- $query .= " and sex in (";
114
- foreach ($sex as $x) {
115
- $query .= "'" . $x . "', ";
 
 
 
 
116
  }
117
- $query = substr($query, 0, -2);
118
- $query .= ")";
119
  }
120
 
121
  $email['query'] = $query;
122
- $email['total'] = $wpdb->get_var(str_replace('*', 'count(*)', $query));
123
-
 
 
 
 
 
124
  if ($controls->is_action('send') && $controls->data['send_on'] < time()) {
125
  $controls->data['send_on'] = time();
126
  }
@@ -236,7 +243,7 @@ if ($controls->is_action('test')) {
236
 
237
  <p class="submit">
238
  <?php $controls->button_back('?page=newsletter_emails_composer&id=' . $email['id']) ?>
239
- <?php if ($email['status'] != 'sending') $controls->button_save(); ?>
240
  <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('test', 'Save and test', 'Save and send test emails to test addresses?'); ?>
241
 
242
  <?php if ($email['status'] == 'new') $controls->button_confirm('send', __('Send', 'newsletter'), __('Start real delivery?', 'newsletter')); ?>
108
  }
109
  }
110
 
111
+ if (isset($controls->data['sex'])) {
112
+ $sex = $controls->data['sex'];
113
+ if (is_array($sex)) {
114
+ $query .= " and sex in (";
115
+ foreach ($sex as $x) {
116
+ $query .= "'" . $x . "', ";
117
+ }
118
+ $query = substr($query, 0, -2);
119
+ $query .= ")";
120
  }
 
 
121
  }
122
 
123
  $email['query'] = $query;
124
+ if ($email['status'] == 'sent') {
125
+ $email['total'] = $email['sent'];
126
+ } else {
127
+ $email['total'] = $wpdb->get_var(str_replace('*', 'count(*)', $query));
128
+ }
129
+
130
+
131
  if ($controls->is_action('send') && $controls->data['send_on'] < time()) {
132
  $controls->data['send_on'] = time();
133
  }
243
 
244
  <p class="submit">
245
  <?php $controls->button_back('?page=newsletter_emails_composer&id=' . $email['id']) ?>
246
+ <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_save(); ?>
247
  <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('test', 'Save and test', 'Save and send test emails to test addresses?'); ?>
248
 
249
  <?php if ($email['status'] == 'new') $controls->button_confirm('send', __('Send', 'newsletter'), __('Start real delivery?', 'newsletter')); ?>
emails/edit.php CHANGED
@@ -111,19 +111,24 @@ if ($controls->is_action('test') || $controls->is_action('save') || $controls->i
111
  }
112
  }
113
 
114
- $sex = $controls->data['sex'];
115
- if (is_array($sex)) {
116
- $query .= " and sex in (";
117
- foreach ($sex as $x) {
118
- $query .= "'" . esc_sql($x) . "', ";
 
 
 
 
119
  }
120
- $query = substr($query, 0, -2);
121
- $query .= ")";
122
  }
123
 
124
  $email['query'] = $query;
125
- $email['total'] = $wpdb->get_var(str_replace('*', 'count(*)', $query));
126
-
 
 
 
127
  if ($controls->is_action('send') && $controls->data['send_on'] < time()) {
128
  $controls->data['send_on'] = time();
129
  }
@@ -281,7 +286,7 @@ if ($email['editor'] == 0) {
281
 
282
  <p class="submit">
283
  <?php $controls->button_back('?page=newsletter_emails_index') ?>
284
- <?php if ($email['status'] != 'sending') $controls->button_save(); ?>
285
  <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('test', 'Save and test', 'Save and send test emails to test addresses?'); ?>
286
 
287
  <?php if ($email['status'] == 'new') $controls->button_confirm('send', __('Send', 'newsletter'), __('Start real delivery?', 'newsletter')); ?>
@@ -396,7 +401,11 @@ if ($email['editor'] == 0) {
396
  </th>
397
  <td>
398
  <?php
399
- echo $wpdb->get_var(str_replace('*', 'count(*)', $email['query']));
 
 
 
 
400
  ?>
401
  <p class="description">
402
  <?php _e('Save to update if on targeting filters have been changed', 'newsletter') ?>
111
  }
112
  }
113
 
114
+ if (isset($controls->data['sex'])) {
115
+ $sex = $controls->data['sex'];
116
+ if (is_array($sex)) {
117
+ $query .= " and sex in (";
118
+ foreach ($sex as $x) {
119
+ $query .= "'" . esc_sql($x) . "', ";
120
+ }
121
+ $query = substr($query, 0, -2);
122
+ $query .= ")";
123
  }
 
 
124
  }
125
 
126
  $email['query'] = $query;
127
+ if ($email['status'] == 'sent') {
128
+ $email['total'] = $email['sent'];
129
+ } else {
130
+ $email['total'] = $wpdb->get_var(str_replace('*', 'count(*)', $query));
131
+ }
132
  if ($controls->is_action('send') && $controls->data['send_on'] < time()) {
133
  $controls->data['send_on'] = time();
134
  }
286
 
287
  <p class="submit">
288
  <?php $controls->button_back('?page=newsletter_emails_index') ?>
289
+ <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_save(); ?>
290
  <?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('test', 'Save and test', 'Save and send test emails to test addresses?'); ?>
291
 
292
  <?php if ($email['status'] == 'new') $controls->button_confirm('send', __('Send', 'newsletter'), __('Start real delivery?', 'newsletter')); ?>
401
  </th>
402
  <td>
403
  <?php
404
+ if ($email['status'] != 'sent') {
405
+ echo $wpdb->get_var(str_replace('*', 'count(*)', $email['query']));
406
+ } else {
407
+ echo $email['sent'];
408
+ }
409
  ?>
410
  <p class="description">
411
  <?php _e('Save to update if on targeting filters have been changed', 'newsletter') ?>
emails/emails.php CHANGED
@@ -19,7 +19,7 @@ class NewsletterEmails extends NewsletterModule {
19
 
20
  function __construct() {
21
  $this->themes = new NewsletterThemes('emails');
22
- parent::__construct('emails', '1.1.2');
23
  add_action('wp_loaded', array($this, 'hook_wp_loaded'));
24
  }
25
 
@@ -66,6 +66,7 @@ class NewsletterEmails extends NewsletterModule {
66
  // Force a token to email without one already set.
67
  $token = self::get_token();
68
  $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set token='" . $token . "' where token=''");
 
69
 
70
  return true;
71
  }
19
 
20
  function __construct() {
21
  $this->themes = new NewsletterThemes('emails');
22
+ parent::__construct('emails', '1.1.4');
23
  add_action('wp_loaded', array($this, 'hook_wp_loaded'));
24
  }
25
 
66
  // Force a token to email without one already set.
67
  $token = self::get_token();
68
  $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set token='" . $token . "' where token=''");
69
+ $wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set total=sent where status='sent' and type='message'");
70
 
71
  return true;
72
  }
emails/index.php CHANGED
@@ -101,7 +101,7 @@ $emails = Newsletter::instance()->get_emails('message');
101
  </thead>
102
 
103
  <tbody>
104
- <?php foreach ($emails as &$email) {
105
  $email_options = unserialize($email->options);
106
  ?>
107
  <tr>
@@ -112,7 +112,8 @@ $emails = Newsletter::instance()->get_emails('message');
112
  echo htmlspecialchars($email->subject);
113
  else
114
  echo "Newsletter #" . $email->id;
115
- ?></td>
 
116
 
117
  <td>
118
  <?php
101
  </thead>
102
 
103
  <tbody>
104
+ <?php foreach ($emails as $email) {
105
  $email_options = unserialize($email->options);
106
  ?>
107
  <tr>
112
  echo htmlspecialchars($email->subject);
113
  else
114
  echo "Newsletter #" . $email->id;
115
+ ?>
116
+ </td>
117
 
118
  <td>
119
  <?php
includes/module.php CHANGED
@@ -100,7 +100,7 @@ class NewsletterModule {
100
  $options = array_merge($default_options, $options);
101
  $this->save_options($options, $sub);
102
  if ($autoload) {
103
- $this->upgrade_query('update ' . $wpdb->options . " set autoload='no' where option_name='" . $this->get_prefix($sub) . "' limit 1");
104
  } else {
105
  $this->upgrade_query('update ' . $wpdb->options . " set autoload='no' where option_name='" . $this->get_prefix($sub) . "' limit 1");
106
  }
100
  $options = array_merge($default_options, $options);
101
  $this->save_options($options, $sub);
102
  if ($autoload) {
103
+ $this->upgrade_query('update ' . $wpdb->options . " set autoload='yes' where option_name='" . $this->get_prefix($sub) . "' limit 1");
104
  } else {
105
  $this->upgrade_query('update ' . $wpdb->options . " set autoload='no' where option_name='" . $this->get_prefix($sub) . "' limit 1");
106
  }
plugin.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Newsletter
5
  Plugin URI: http://www.thenewsletterplugin.com/plugins/newsletter
6
  Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
- Version: 4.5.6
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: http://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
@@ -14,7 +14,7 @@
14
  */
15
 
16
  // Used as dummy parameter on css and js links
17
- define('NEWSLETTER_VERSION', '4.5.6');
18
 
19
  global $wpdb, $newsletter;
20
 
4
  Plugin Name: Newsletter
5
  Plugin URI: http://www.thenewsletterplugin.com/plugins/newsletter
6
  Description: Newsletter is a cool plugin to create your own subscriber list, to send newsletters, to build your business. <strong>Before update give a look to <a href="http://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
+ Version: 4.5.7
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: http://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
14
  */
15
 
16
  // Used as dummy parameter on css and js links
17
+ define('NEWSLETTER_VERSION', '4.5.7');
18
 
19
  global $wpdb, $newsletter;
20
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated
3
  Requires at least: 3.4.0
4
  Tested up to: 4.5.3
5
- Stable tag: 4.5.6
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
@@ -77,6 +77,14 @@ Thank you, The Newsletter Team
77
 
78
  == Changelog ==
79
 
 
 
 
 
 
 
 
 
80
  = 4.5.6 =
81
 
82
  * New unified themes and composer selection screen
2
  Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated
3
  Requires at least: 3.4.0
4
  Tested up to: 4.5.3
5
+ Stable tag: 4.5.7
6
  Contributors: satollo,webagile,michael-travan
7
 
8
  Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
77
 
78
  == Changelog ==
79
 
80
+ = 4.5.7 =
81
+
82
+ * Fixed the total sent email in dashboard
83
+ * Fixed the total sent number on newsletter list when an already sent newsletter is edited
84
+ * Removed the save button on sent newsletter
85
+ * Code cleanup
86
+ * Service message for stats panel of draft newsletters
87
+
88
  = 4.5.6 =
89
 
90
  * New unified themes and composer selection screen
statistics/index.php CHANGED
@@ -48,25 +48,24 @@ $open_count_total = 0;
48
  $click_count_total = 0;
49
  foreach ($emails as $email) {
50
  $entry = array();
51
- $total_sent += $email->total;
52
- if (empty($email->total)) {
53
  // $entry[0] = date('Y-m-d', $email->send_on);
54
  // $entry[1] = 0;
55
- // $entry[2] = $email->subject;// . ' (' . percent($open_count, $email->total) . ')';
56
  // $entry[3] = 0;
57
  continue;
58
  }
59
  //$entry[0] = $email->subject . ' [' . date('Y-m-d', $email->send_on) . ', ' . $email->type . ']';
60
- $total_sent += $email->total;
61
  $entry[0] = date('Y-m-d', $email->send_on);
62
  $open_count = $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where email_id=" . $email->id);
63
  $open_count_total += $open_count;
64
- $entry[1] = $open_count / $email->total * 100;
65
  $entry[1] = round($entry[1], 2);
66
- $entry[2] = $email->subject; // . ' (' . percent($open_count, $email->total) . ')';
67
  $click_count = $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where url<>'' and email_id=" . $email->id);
68
  $click_count_total += $click_count;
69
- $entry[3] = $click_count / $email->total * 100;
70
  $entry[3] = round($entry[3], 2);
71
 
72
  $overview_labels[] = strftime('%a, %e %b', $email->send_on);
48
  $click_count_total = 0;
49
  foreach ($emails as $email) {
50
  $entry = array();
51
+ $total_sent += $email->sent;
52
+ if (empty($email->sent)) {
53
  // $entry[0] = date('Y-m-d', $email->send_on);
54
  // $entry[1] = 0;
55
+ // $entry[2] = $email->subject;// . ' (' . percent($open_count, $email->sent) . ')';
56
  // $entry[3] = 0;
57
  continue;
58
  }
59
  //$entry[0] = $email->subject . ' [' . date('Y-m-d', $email->send_on) . ', ' . $email->type . ']';
 
60
  $entry[0] = date('Y-m-d', $email->send_on);
61
  $open_count = $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where email_id=" . $email->id);
62
  $open_count_total += $open_count;
63
+ $entry[1] = $open_count / $email->sent * 100;
64
  $entry[1] = round($entry[1], 2);
65
+ $entry[2] = $email->subject; // . ' (' . percent($open_count, $email->sent) . ')';
66
  $click_count = $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where url<>'' and email_id=" . $email->id);
67
  $click_count_total += $click_count;
68
+ $entry[3] = $click_count / $email->sent * 100;
69
  $entry[3] = round($entry[3], 2);
70
 
71
  $overview_labels[] = strftime('%a, %e %b', $email->send_on);
statistics/view.php CHANGED
@@ -32,19 +32,21 @@ if (true || $count == 0) {
32
  $wpdb->query($wpdb->prepare("update " . $wpdb->prefix . "newsletter_sent s1 join " . $wpdb->prefix . "newsletter_stats s2 on s1.user_id=s2.user_id and s1.email_id=s2.email_id and s2.url<>'' and s1.email_id=%d set s1.open=2, s1.ip=s2.ip", $email->id));
33
  }
34
 
35
- $total_count = $total_sent = $email->total;
36
  $open_count = (int) $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where email_id=" . $email_id);
37
  $click_count = (int) $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where url<>'' and email_id=" . $email_id);
38
 
39
  function percent($value, $total) {
40
- if ($total == 0)
41
  return '-';
 
42
  return sprintf("%.2f", $value / $total * 100) . '%';
43
  }
44
 
45
  function percentValue($value, $total) {
46
- if ($total == 0)
47
  return 0;
 
48
  return round($value / $total * 100);
49
  }
50
  ?>
@@ -65,6 +67,12 @@ function percentValue($value, $total) {
65
 
66
 
67
  <div id="tnp-body" style="min-width: 500px">
 
 
 
 
 
 
68
 
69
  <form action="" method="post">
70
  <?php $controls->init(); ?>
@@ -143,7 +151,7 @@ function percentValue($value, $total) {
143
  <div class="tnp-data-value"><?php echo $email->sent; ?> of <?php echo $email->total; ?></div>
144
  <?php else: ?>
145
  <div class="tnp-data-title">Total Sent</div>
146
- <div class="tnp-data-value"><?php echo $email->total; ?></div>
147
  <?php endif; ?>
148
  </div>
149
  <div class="tnp-data">
@@ -184,6 +192,8 @@ function percentValue($value, $total) {
184
 
185
 
186
  </form>
 
 
187
 
188
  </div>
189
  <?php include NEWSLETTER_DIR . '/tnp-footer.php' ?>
32
  $wpdb->query($wpdb->prepare("update " . $wpdb->prefix . "newsletter_sent s1 join " . $wpdb->prefix . "newsletter_stats s2 on s1.user_id=s2.user_id and s1.email_id=s2.email_id and s2.url<>'' and s1.email_id=%d set s1.open=2, s1.ip=s2.ip", $email->id));
33
  }
34
 
35
+ $total_count = $total_sent = $email->sent;
36
  $open_count = (int) $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where email_id=" . $email_id);
37
  $click_count = (int) $wpdb->get_var("select count(distinct user_id) from " . NEWSLETTER_STATS_TABLE . " where url<>'' and email_id=" . $email_id);
38
 
39
  function percent($value, $total) {
40
+ if ($total == 0) {
41
  return '-';
42
+ }
43
  return sprintf("%.2f", $value / $total * 100) . '%';
44
  }
45
 
46
  function percentValue($value, $total) {
47
+ if ($total == 0) {
48
  return 0;
49
+ }
50
  return round($value / $total * 100);
51
  }
52
  ?>
67
 
68
 
69
  <div id="tnp-body" style="min-width: 500px">
70
+
71
+ <?php if ($email->status == 'new') { ?>
72
+
73
+ <div class="tnp-warning"><?php _e('No data, newsletter not sent yet.', 'newsletter')?></div>
74
+
75
+ <?php } else { ?>
76
 
77
  <form action="" method="post">
78
  <?php $controls->init(); ?>
151
  <div class="tnp-data-value"><?php echo $email->sent; ?> of <?php echo $email->total; ?></div>
152
  <?php else: ?>
153
  <div class="tnp-data-title">Total Sent</div>
154
+ <div class="tnp-data-value"><?php echo $email->sent; ?></div>
155
  <?php endif; ?>
156
  </div>
157
  <div class="tnp-data">
192
 
193
 
194
  </form>
195
+
196
+ <?php } // if "new" ?>
197
 
198
  </div>
199
  <?php include NEWSLETTER_DIR . '/tnp-footer.php' ?>
subscription/options.php CHANGED
@@ -70,7 +70,7 @@ if ($controls->is_action()) {
70
  $page_id = wp_insert_post($page);
71
 
72
  $controls->data['url'] = get_permalink($page_id);
73
- $module->save_options($controls->data);
74
  }
75
 
76
  if ($controls->is_action('reset')) {
70
  $page_id = wp_insert_post($page);
71
 
72
  $controls->data['url'] = get_permalink($page_id);
73
+ $module->merge_options($controls->data);
74
  }
75
 
76
  if ($controls->is_action('reset')) {
subscription/subscription.php CHANGED
@@ -21,7 +21,7 @@ class NewsletterSubscription extends NewsletterModule {
21
 
22
  function __construct() {
23
 
24
- parent::__construct('subscription', '2.0.1');
25
 
26
  // $this->options_lock = $this->get_options('lock');
27
 
@@ -169,59 +169,20 @@ class NewsletterSubscription extends NewsletterModule {
169
  $this->save_options($this->options);
170
  }
171
 
172
- // Locked content configuration migration
173
- // $options_lock = $this->get_options('lock');
174
- // if (empty($options_lock)) {
175
- // $options_main = Newsletter::instance()->get_options();
176
- // if (isset($options_main['lock_message'])) {
177
- // $options_lock['ids'] = $options_main['lock_ids'];
178
- // $options_lock['url'] = $options_main['lock_url'];
179
- // $options_lock['message'] = $options_main['lock_message'];
180
- // update_option('newsletter_subscription_lock', $options_lock);
181
- // }
182
- // }
183
- //
184
- // $this->init_options('lock');
185
-
186
  $options_template = $this->get_options('template');
187
- if (empty($options_template)) {
188
  $options_template['enabled'] = isset($this->options['template_enabled']) ? 1 : 0;
189
- $options_template['template'] = isset($this->options['template']) ? $this->options['template'] : '';
190
  add_option('newsletter_subscription_template', $options_template, null, 'no');
191
  }
192
  $this->init_options('template', false);
 
 
 
 
 
 
193
 
194
- // $options_wp = $this->get_options('wp');
195
- // if (empty($options_wp)) {
196
- // if (isset($this->options['wp_welcome'])) {
197
- // $options_wp['welcome'] = $this->options['wp_welcome'];
198
- // }
199
- // if (isset($this->options['wp_delete'])) {
200
- // $options_wp['delete'] = $this->options['wp_delete'];
201
- // }
202
- // if (isset($this->options['subscribe_wp_users_label'])) {
203
- // $options_wp['subscribe_label'] = $this->options['subscribe_wp_users_label'];
204
- // }
205
- // if (isset($this->options['subscribe_wp_users'])) {
206
- // $options_wp['subscribe'] = $this->options['subscribe_wp_users'];
207
- // }
208
- // if (isset($this->options['send_confirmation'])) {
209
- // $options_wp['confirmation'] = $this->options['send_confirmation'];
210
- // }
211
- // $this->save_options($options_wp, 'wp');
212
- //
213
- // unset($this->options['wp_welcome']);
214
- // unset($this->options['wp_delete']);
215
- // unset($this->options['subscribe_wp_users_label']);
216
- // unset($this->options['subscribe_wp_users']);
217
- // unset($this->options['send_confirmation']);
218
- // $this->save_options($this->options);
219
- // }
220
- //
221
- // $this->init_options('wp', false);
222
-
223
- // Because users do not understand how to create an "extensions" folder...
224
- //@wp_mkdir_p(WP_CONTENT_DIR . '/extensions/newsletter/subscription');
225
  return true;
226
  }
227
 
@@ -516,7 +477,7 @@ class NewsletterSubscription extends NewsletterModule {
516
  }
517
 
518
  // Preferences (field names are nl[] and values the list number so special forms with radio button can work)
519
- if (is_array($_REQUEST['nl'])) {
520
  $this->logger->debug($_REQUEST['nl']);
521
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
522
  // If not zero it is selectable by user (on subscription or on profile)
21
 
22
  function __construct() {
23
 
24
+ parent::__construct('subscription', '2.0.2');
25
 
26
  // $this->options_lock = $this->get_options('lock');
27
 
169
  $this->save_options($this->options);
170
  }
171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  $options_template = $this->get_options('template');
173
+ if (empty($options_template) && isset($this->options['template'])) {
174
  $options_template['enabled'] = isset($this->options['template_enabled']) ? 1 : 0;
175
+ $options_template['template'] = $this->options['template'];
176
  add_option('newsletter_subscription_template', $options_template, null, 'no');
177
  }
178
  $this->init_options('template', false);
179
+
180
+ if (isset($this->options['template'])) {
181
+ unset($this->options['template']);
182
+ unset($this->options['template_enabled']);
183
+ $this->save_options($this->options);
184
+ }
185
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  return true;
187
  }
188
 
477
  }
478
 
479
  // Preferences (field names are nl[] and values the list number so special forms with radio button can work)
480
+ if (isset($_REQUEST['nl']) && is_array($_REQUEST['nl'])) {
481
  $this->logger->debug($_REQUEST['nl']);
482
  for ($i = 1; $i <= NEWSLETTER_LIST_MAX; $i++) {
483
  // If not zero it is selectable by user (on subscription or on profile)