Newsletter - Version 6.3.3

Version Description

  • Fixed the missing admin notification when using the internal SMTP
Download this release

Release Info

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

Code changes from version 6.3.2 to 6.3.3

Files changed (4) hide show
  1. includes/mailers.php +22 -10
  2. includes/module.php +1 -0
  3. plugin.php +2 -2
  4. readme.txt +5 -1
includes/mailers.php CHANGED
@@ -201,9 +201,17 @@ class NewsletterDefaultSMTPMailer extends NewsletterMailer {
201
  $logger = $this->get_logger();
202
  $logger->debug('Start sending to ' . $message->to);
203
  $mailer = $this->get_mailer();
204
- $mailer->IsHTML(true);
205
- $mailer->Body = $message->body;
206
- $mailer->AltBody = $message->body_text;
 
 
 
 
 
 
 
 
207
  $mailer->Subject = $message->subject;
208
 
209
  $mailer->ClearCustomHeaders();
@@ -216,6 +224,9 @@ class NewsletterDefaultSMTPMailer extends NewsletterMailer {
216
  if ($message->from) {
217
  $logger->debug('Alternative from available');
218
  $mailer->setFrom($message->from, $message->from_name);
 
 
 
219
  }
220
 
221
  $mailer->ClearAddresses();
@@ -242,11 +253,12 @@ class NewsletterDefaultSMTPMailer extends NewsletterMailer {
242
  * @return PHPMailer
243
  */
244
  function get_mailer() {
245
- if ($this->mailer)
246
  return $this->mailer;
 
247
 
248
  $logger = $this->get_logger();
249
- $logger->info('Setting up PHP mailer');
250
  require_once ABSPATH . WPINC . '/class-phpmailer.php';
251
  require_once ABSPATH . WPINC . '/class-smtp.php';
252
 
@@ -278,11 +290,11 @@ class NewsletterDefaultSMTPMailer extends NewsletterMailer {
278
 
279
  $newsletter = Newsletter::instance();
280
 
281
- if (!empty($newsletter->options['content_transfer_encoding'])) {
282
- $this->mailer->Encoding = $newsletter->options['content_transfer_encoding'];
283
- } else {
284
- $this->mailer->Encoding = 'base64';
285
- }
286
 
287
  $this->mailer->CharSet = 'UTF-8';
288
  $this->mailer->From = $newsletter->options['sender_email'];
201
  $logger = $this->get_logger();
202
  $logger->debug('Start sending to ' . $message->to);
203
  $mailer = $this->get_mailer();
204
+
205
+ if (!empty($message->body)) {
206
+ $mailer->IsHTML(true);
207
+ $mailer->Body = $message->body;
208
+ $mailer->AltBody = $message->body_text;
209
+ } else {
210
+ $mailer->IsHTML(false);
211
+ $mailer->Body = $message->body_text;
212
+ $mailer->AltBody = '';
213
+ }
214
+
215
  $mailer->Subject = $message->subject;
216
 
217
  $mailer->ClearCustomHeaders();
224
  if ($message->from) {
225
  $logger->debug('Alternative from available');
226
  $mailer->setFrom($message->from, $message->from_name);
227
+ } else {
228
+ $newsletter = Newsletter::instance();
229
+ $mailer->setFrom($newsletter->options['sender_email'], $newsletter->options['sender_name']);
230
  }
231
 
232
  $mailer->ClearAddresses();
253
  * @return PHPMailer
254
  */
255
  function get_mailer() {
256
+ if ($this->mailer) {
257
  return $this->mailer;
258
+ }
259
 
260
  $logger = $this->get_logger();
261
+ $logger->debug('Setting up PHP mailer');
262
  require_once ABSPATH . WPINC . '/class-phpmailer.php';
263
  require_once ABSPATH . WPINC . '/class-smtp.php';
264
 
290
 
291
  $newsletter = Newsletter::instance();
292
 
293
+ // if (!empty($newsletter->options['content_transfer_encoding'])) {
294
+ // $this->mailer->Encoding = $newsletter->options['content_transfer_encoding'];
295
+ // } else {
296
+ // $this->mailer->Encoding = 'base64';
297
+ // }
298
 
299
  $this->mailer->CharSet = 'UTF-8';
300
  $this->mailer->From = $newsletter->options['sender_email'];
includes/module.php CHANGED
@@ -1750,6 +1750,7 @@ class NewsletterModule {
1750
  */
1751
  function build_action_url($action, $user = null, $email = null) {
1752
  $url = $this->add_qs($this->get_home_url(), 'na=' . urlencode($action));
 
1753
  if ($user) {
1754
  $url .= '&nk=' . urlencode($this->get_user_key($user));
1755
  }
1750
  */
1751
  function build_action_url($action, $user = null, $email = null) {
1752
  $url = $this->add_qs($this->get_home_url(), 'na=' . urlencode($action));
1753
+ $url = $this->add_qs(admin_url('admin-ajax.php'), 'action=newsletter&na=' . urlencode($action));
1754
  if ($user) {
1755
  $url .= '&nk=' . urlencode($this->get_user_key($user));
1756
  }
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.3.2
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.
@@ -29,7 +29,7 @@
29
  */
30
 
31
  // Used as dummy parameter on css and js links
32
- define('NEWSLETTER_VERSION', '6.3.2');
33
 
34
  global $newsletter, $wpdb;
35
 
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.3.3
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.
29
  */
30
 
31
  // Used as dummy parameter on css and js links
32
+ define('NEWSLETTER_VERSION', '6.3.3');
33
 
34
  global $newsletter, $wpdb;
35
 
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.2.3
5
- Stable tag: 6.3.2
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
 
@@ -109,6 +109,10 @@ Thank you, The Newsletter Team
109
 
110
  == Changelog ==
111
 
 
 
 
 
112
  = 6.3.2 =
113
 
114
  * Fixed the admin notification email not sent or bot correctly formatted
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.2.3
5
+ Stable tag: 6.3.3
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
 
109
 
110
  == Changelog ==
111
 
112
+ = 6.3.3 =
113
+
114
+ * Fixed the missing admin notification when using the internal SMTP
115
+
116
  = 6.3.2 =
117
 
118
  * Fixed the admin notification email not sent or bot correctly formatted