Newsletter - Version 6.7.0

Version Description

  • Fixed the text part not sent when using the standard mailing function of WP
  • Added warning on statistic panel for email without the tracking active
  • Fixed the hero block align when specified manually with text-align on text part
Download this release

Release Info

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

Code changes from version 6.6.9 to 6.7.0

emails/blocks/hero/block-right.php CHANGED
@@ -35,33 +35,31 @@
35
  <div dir="rtl">
36
 
37
  <table width="49%" align="right" class="hero-table" border="0" cellspacing="0" cellpadding="0">
38
- <tr>
39
- <td align="center" valign="top">
40
- <a href="<?php echo $url ?>" target="_blank" rel="noopener nofollow" inline-class="image-a">
41
- <img src="<?php echo $media->url ?>" border="0" alt="<?php echo esc_attr($media->alt) ?>" width="<?php echo $media->width ?>" height="<?php echo $media->height ?>" inline-class="image">
42
- </a>
43
- </td>
44
- </tr>
45
- </table>
46
-
47
- <table width="49%" align="left" class="hero-table hero-table-right" border="0" cellspacing="0" cellpadding="0">
48
- <tr>
49
- <td align="center" inline-class="title">
50
- <?php echo $options['title'] ?>
51
- </td>
52
- </tr>
53
- <tr>
54
- <td align="center" inline-class="text">
55
- <?php echo $options['text'] ?>
56
- </td>
57
- </tr>
58
- <tr>
59
- <td align="center" inline-class="button">
60
- <?php echo tnpc_button($options) ?>
61
- </td>
62
- </tr>
63
- </table>
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
-
67
  </div>
35
  <div dir="rtl">
36
 
37
  <table width="49%" align="right" class="hero-table" border="0" cellspacing="0" cellpadding="0">
38
+ <tr>
39
+ <td align="center" valign="top" dir="ltr">
40
+ <a href="<?php echo $url ?>" target="_blank" rel="noopener nofollow" inline-class="image-a">
41
+ <img src="<?php echo $media->url ?>" border="0" alt="<?php echo esc_attr($media->alt) ?>" width="<?php echo $media->width ?>" height="<?php echo $media->height ?>" inline-class="image">
42
+ </a>
43
+ </td>
44
+ </tr>
45
+ </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
+ <table width="49%" align="left" class="hero-table hero-table-right" border="0" cellspacing="0" cellpadding="0">
48
+ <tr>
49
+ <td align="center" inline-class="title" dir="ltr">
50
+ <?php echo $options['title'] ?>
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td align="center" inline-class="text" dir="ltr">
55
+ <?php echo $options['text'] ?>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <td align="center" inline-class="button" dir="ltr">
60
+ <?php echo tnpc_button($options) ?>
61
+ </td>
62
+ </tr>
63
+ </table>
64
 
 
65
  </div>
includes/mailer.php CHANGED
@@ -337,8 +337,9 @@ class NewsletterDefaultMailer extends NewsletterMailer {
337
  /* @var $mailer PHPMailer */
338
  $mailer->Sender = $newsletter->options['return_path'];
339
 
340
- if (!empty($this->current_message->current_message->body) && !empty($this->current_message->current_message->body_text)) {
341
- $mailer->AltBody = $this->current_message->current_message->body_text;
 
342
  }
343
  }
344
 
337
  /* @var $mailer PHPMailer */
338
  $mailer->Sender = $newsletter->options['return_path'];
339
 
340
+ // If there is an HTML body AND a text body, add the text part.
341
+ if (!empty($this->current_message->body) && !empty($this->current_message->body_text)) {
342
+ $mailer->AltBody = $this->current_message->body_text;
343
  }
344
  }
345
 
main/test.php ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Newsletter */
3
+ /* @var $wpdb wpdb */
4
+
5
+ defined('ABSPATH') || exit;
6
+
7
+ include_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
8
+ $controls = new NewsletterControls();
9
+
10
+
11
+ if ($controls->is_action('test')) {
12
+
13
+ if (!NewsletterModule::is_email($controls->data['test_email'])) {
14
+ $controls->errors = 'The test email address is not set or is not correct.';
15
+ }
16
+
17
+ if (empty($controls->errors)) {
18
+
19
+ $options = $controls->data;
20
+
21
+ if ($controls->data['test_email'] == $this->options['sender_email']) {
22
+ $controls->messages .= '<strong>Warning:</strong> you are using as test email the same address configured as sender in main configuration. Test can fail because of that.<br>';
23
+ }
24
+
25
+ $message = new TNP_Mailer_Message();
26
+ $message->body = '<p>This is an <b>HTML</b> test email sent using the sender data set on Newsletter main setting. <a href="https://www.thenewsletterplugin.com">This is a link to an external site</a>.</p>';
27
+ $message->body_text = 'This is a textual test email part sent using the sender data set on Newsletter main setting.';
28
+ $message->to = $controls->data['test_email'];
29
+ $message->subject = 'Newsletter test email at ' . date(DATE_ISO8601);
30
+ $message->from = $this->options['sender_email'];
31
+ $message->from_name = $this->options['sender_name'];
32
+
33
+ $r = $this->deliver($message);
34
+
35
+ if (!is_wp_error($r)) {
36
+ $options['mail'] = 1;
37
+ $controls->messages .= '<strong>SUCCESS</strong><br>';
38
+ $controls->messages .= 'Anyway if the message does not appear the mailbox (check even the spam folder) you can ';
39
+ $controls->messages .= '<a href="https://www.thenewsletterplugin.com/documentation/?p=15170" target="_blank"><strong>read more here</strong></a>.';
40
+ } else {
41
+ $options['mail'] = 0;
42
+ $options['mail_error'] = $r->get_error_message();
43
+
44
+ $controls->errors .= '<strong>FAILED</strong> (' . $r->get_error_message() . ')<br>';
45
+
46
+ if (!empty($this->options['return_path'])) {
47
+ $controls->errors .= '- Try to remove the return path on main settings.<br>';
48
+ }
49
+
50
+ $controls->errors .= '<a href="https://www.thenewsletterplugin.com/documentation/?p=15170" target="_blank"><strong>' . __('Read more', 'newsletter') . '</strong></a>.';
51
+
52
+ $parts = explode('@', $this->options['sender_email']);
53
+ $sitename = strtolower($_SERVER['SERVER_NAME']);
54
+ if (substr($sitename, 0, 4) == 'www.') {
55
+ $sitename = substr($sitename, 4);
56
+ }
57
+ if (strtolower($sitename) != strtolower($parts[1])) {
58
+ $controls->errors .= '- Try to set on main setting a sender address with the same domain of your blog: ' . $sitename . ' (you are using ' . $this->options['sender_email'] . ')<br>';
59
+ }
60
+ }
61
+ $this->save_options($options, 'status');
62
+ }
63
+ }
64
+
65
+ $options = $this->get_options('status');
66
+ ?>
67
+
68
+ <div class="wrap tnp-main-status" id="tnp-wrap">
69
+
70
+ <?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
71
+
72
+ <div id="tnp-heading">
73
+
74
+ <h2><?php _e('Mailing test', 'newsletter') ?></h2>
75
+
76
+ </div>
77
+
78
+ <div id="tnp-body">
79
+
80
+ <form method="post" action="">
81
+ <?php $controls->init(); ?>
82
+
83
+ <h3>Mailing test</h3>
84
+ <table class="widefat" id="tnp-status-table">
85
+
86
+ <thead>
87
+ <tr>
88
+ <th>Parameter</th>
89
+ <th><?php _e('Status', 'newsletter') ?></th>
90
+ <th>Action</th>
91
+ </tr>
92
+ </thead>
93
+
94
+ <tbody>
95
+ <tr>
96
+ <td>Mailing</td>
97
+ <td>
98
+ <?php if (empty($options['mail'])) { ?>
99
+ <span class="tnp-ko">KO</span>
100
+ <?php } else { ?>
101
+ <span class="tnp-ok">OK</span>
102
+ <?php } ?>
103
+
104
+ </td>
105
+ <td>
106
+ <?php if (empty($options['mail'])) { ?>
107
+ <?php if (empty($options['mail_error'])) { ?>
108
+ A test has never run.
109
+ <?php } else { ?>
110
+ Last test failed with error "<?php echo esc_html($options['mail_error']) ?>".
111
+
112
+ <?php } ?>
113
+ <?php } else { ?>
114
+ Last test was successful. If you didn't receive the test email:
115
+ <ol>
116
+ <li>If you set the Newsletter SMTP, do a test from that panel</li>
117
+ <li>If you're using a integration extension do a test from its configuration panel</li>
118
+ <li>If previous points do not apply to you, ask for support to your provider reporting the emails from your blog are not delivered</li>
119
+ </ol>
120
+ <?php } ?>
121
+ <br>
122
+ <a href="https://www.thenewsletterplugin.com/documentation/email-sending-issues" target="_blank">Read more to solve your issues, if any</a>.
123
+ <br>
124
+ Email: <?php $controls->text_email('test_email') ?> <?php $controls->button('test', __('Send a test message')) ?>
125
+ </td>
126
+
127
+ </tr>
128
+
129
+ <tr>
130
+ <td>Mailer</td>
131
+ <td>
132
+ &nbsp;
133
+ </td>
134
+ <td>
135
+ <?php
136
+ $mailer = Newsletter::instance()->get_mailer();
137
+ $name = 'Unknown';
138
+ if (is_object($mailer)) {
139
+ if (method_exists($mailer, 'get_description')) {
140
+ $name = $mailer->get_description();
141
+ } else {
142
+ $name = get_class($mailer);
143
+ }
144
+ }
145
+ ?>
146
+
147
+ <?php echo esc_html($name) ?>
148
+ </td>
149
+ </tr>
150
+
151
+ </tbody>
152
+ </table>
153
+ </form>
154
+ </div>
155
+
156
+ <?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
157
+
158
+ </div>
plugin.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Newsletter
5
  Plugin URI: https://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="https://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
- Version: 6.6.9
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: https://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
@@ -35,7 +35,7 @@ if (version_compare(phpversion(), '5.6', '<')) {
35
  return;
36
  }
37
 
38
- define('NEWSLETTER_VERSION', '6.6.9');
39
 
40
  global $newsletter, $wpdb;
41
 
@@ -456,6 +456,7 @@ class Newsletter extends NewsletterModule {
456
  $this->add_menu_page('main', __('Settings and More', 'newsletter'));
457
  $this->add_admin_page('smtp', 'SMTP');
458
  $this->add_admin_page('status', __('Status', 'newsletter'));
 
459
  }
460
  }
461
 
4
  Plugin Name: Newsletter
5
  Plugin URI: https://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="https://www.thenewsletterplugin.com/category/release">this page</a> to know what's changed.</strong>
7
+ Version: 6.7.0
8
  Author: Stefano Lissa & The Newsletter Team
9
  Author URI: https://www.thenewsletterplugin.com
10
  Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
35
  return;
36
  }
37
 
38
+ define('NEWSLETTER_VERSION', '6.7.0');
39
 
40
  global $newsletter, $wpdb;
41
 
456
  $this->add_menu_page('main', __('Settings and More', 'newsletter'));
457
  $this->add_admin_page('smtp', 'SMTP');
458
  $this->add_admin_page('status', __('Status', 'newsletter'));
459
+ $this->add_admin_page('test', __('Test', 'newsletter'));
460
  }
461
  }
462
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Tags: email, email marketing, newsletter, newsletter subscribers, welcome email, signup forms, contact, lead generation, popup, marketing automation
3
  Requires at least: 3.4.0
4
  Tested up to: 5.4.1
5
- Stable tag: 6.6.9
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
 
@@ -74,6 +74,10 @@ Need *more power*? Feel *something's missing*? The Newsletter Plugin features ca
74
  * [Subscribe on Comment](https://www.thenewsletterplugin.com/documentation/comments-extension) - adds the subscription option to your blog comment form
75
  * [Geolocation](https://www.thenewsletterplugin.com/documentation/geolocation-extension) - adds geolocation capability to target subscribers by location
76
 
 
 
 
 
77
  = GDPR =
78
 
79
  The Newsletter Plugin provides all the technical tools needed to achieve GDPR compliancy and we're continuously working to improve them and to give support even for specific use cases.
@@ -109,6 +113,12 @@ Thank you, The Newsletter Team
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
 
112
  = 6.6.9 =
113
 
114
  * Fixed the admin email preview not showing the correct email after visiting the online view of a newsletter
2
  Tags: email, email marketing, newsletter, newsletter subscribers, welcome email, signup forms, contact, lead generation, popup, marketing automation
3
  Requires at least: 3.4.0
4
  Tested up to: 5.4.1
5
+ Stable tag: 6.7.0
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
 
74
  * [Subscribe on Comment](https://www.thenewsletterplugin.com/documentation/comments-extension) - adds the subscription option to your blog comment form
75
  * [Geolocation](https://www.thenewsletterplugin.com/documentation/geolocation-extension) - adds geolocation capability to target subscribers by location
76
 
77
+ = (NEW!) Third Party Addons =
78
+
79
+ * [WP User Manager addon for Newsletter](https://wordpress.org/plugins/wpum-newsletter/) - adds the subscription option on registration forms
80
+
81
  = GDPR =
82
 
83
  The Newsletter Plugin provides all the technical tools needed to achieve GDPR compliancy and we're continuously working to improve them and to give support even for specific use cases.
113
 
114
  == Changelog ==
115
 
116
+ = 6.7.0 =
117
+
118
+ * Fixed the text part not sent when using the standard mailing function of WP
119
+ * Added warning on statistic panel for email without the tracking active
120
+ * Fixed the hero block align when specified manually with text-align on text part
121
+
122
  = 6.6.9 =
123
 
124
  * Fixed the admin email preview not showing the correct email after visiting the online view of a newsletter
statistics/view.php CHANGED
@@ -17,6 +17,10 @@ if ($email->status == 'new') {
17
  $controls->warnings[] = __('Newsletter still sending', 'newsletter');
18
  }
19
 
 
 
 
 
20
  ?>
21
 
22
  <div class="wrap tnp-statistics tnp-statistics-view" id="tnp-wrap">
17
  $controls->warnings[] = __('Newsletter still sending', 'newsletter');
18
  }
19
 
20
+ if (empty($email->track)) {
21
+ $controls->warnings[] = __('This newsletter has the tracking disabled. No statistics will be available.', 'newsletter');
22
+ }
23
+
24
  ?>
25
 
26
  <div class="wrap tnp-statistics tnp-statistics-view" id="tnp-wrap">