Newsletter - Version 6.6.2

Version Description

  • Fixed incomplete blocks package on previous release
Download this release

Release Info

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

Code changes from version 6.6.0 to 6.6.2

admin.css CHANGED
@@ -1,9 +1,9 @@
1
  @import url('https://use.typekit.net/jlj2wjy.css');
2
- @import url('vendor/fa/css/all.min.css');
3
- @import url('css/dropdown.css');
4
- @import url('vendor/jquery-ui/jquery-ui.min.css');
5
- @import url('css/fields.css');
6
- @import url('css/widgets.css');
7
 
8
  /* Bootstrap like */
9
 
1
  @import url('https://use.typekit.net/jlj2wjy.css');
2
+ @import url('vendor/fa/css/all.min.css?ver=6.6.0');
3
+ @import url('css/dropdown.css?ver=6.6.0');
4
+ @import url('vendor/jquery-ui/jquery-ui.min.css?ver=6.6.0');
5
+ @import url('css/fields.css?ver=6.6.0');
6
+ @import url('css/widgets.css?ver=6.6.0');
7
 
8
  /* Bootstrap like */
9
 
emails/blocks/hero/block-full.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style>
2
+ /* Styles which will be removed and injected in the replacing the matching "inline-class" attribute */
3
+ .title {
4
+ font-size: <?php echo $title_font_size ?>px;
5
+ color: <?php echo $title_font_color ?>;
6
+ font-family: <?php echo $title_font_family ?>;
7
+ font-weight: <?php echo $title_font_weight ?>;
8
+ line-height: normal;
9
+ margin: 0;
10
+ }
11
+ .text {
12
+ padding: 20px 0 0 0;
13
+ font-size: <?php echo $font_size ?>px;
14
+ line-height: 150%;
15
+ color: <?php echo $font_color ?>;
16
+ font-family: <?php echo $font_family ?>;
17
+ margin: 0;
18
+ }
19
+ .image {
20
+ max-width: 100%!important;
21
+ display: inline-block;
22
+ border: 0px;
23
+ margin: 0;
24
+ }
25
+ .image-a {
26
+ display: block;
27
+ }
28
+ </style>
29
+
30
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
31
+ <?php if ($media) { ?>
32
+ <tr>
33
+ <td class="padding-copy tnpc-row-edit" align="center" style="text-align: center; line-height: 0; padding-bottom: 20px;">
34
+ <a href="<?php echo $url ?>" target="_blank" rel="noopener nofollow" inline-class="image-a">
35
+ <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">
36
+ </a>
37
+ </td>
38
+ </tr>
39
+ <?php } ?>
40
+
41
+ <tr>
42
+ <td align="center" inline-class="title">
43
+ <span><?php echo $options['title'] ?></span>
44
+ </td>
45
+ </tr>
46
+ <tr>
47
+ <td align="center" inline-class="text">
48
+ <span><?php echo $options['text'] ?></span>
49
+ </td>
50
+ </tr>
51
+
52
+ <tr>
53
+ <td align="center">
54
+ <br>
55
+ <?php echo tnpc_button($options) ?>
56
+ </td>
57
+ </tr>
58
+ </table>
emails/blocks/hero/block-left.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style>
2
+ /* Styles which will be removed and injected in the replacing the matching "inline-class" attribute */
3
+ .title {
4
+ font-size: <?php echo $title_font_size ?>px;
5
+ color: <?php echo $title_font_color ?>;
6
+ padding-top: 0;
7
+ font-family: <?php echo $title_font_family ?>;
8
+ font-weight: <?php echo $title_font_weight ?>;
9
+ margin: 0;
10
+ text-align: center;
11
+ line-height: normal;
12
+ }
13
+ .text {
14
+ padding: 20px 0 0 0;
15
+ font-size: <?php echo $font_size ?>px;
16
+ line-height: 150%;
17
+ color: <?php echo $font_color ?>;
18
+ font-family: <?php echo $font_family ?>;
19
+ font-weight: <?php echo $font_weight ?>;
20
+ margin: 0;
21
+ text-align: center;
22
+ }
23
+ .image {
24
+ max-width: 100%!important;
25
+ display: block;
26
+ }
27
+ .image-a {
28
+ display: block;
29
+ }
30
+ .button {
31
+ padding-top: 15px;
32
+ }
33
+ </style>
34
+
35
+ <table width="49%" align="left" class="hero-table" border="0" cellspacing="0" cellpadding="0">
36
+ <tr>
37
+ <td align="center" valign="top">
38
+ <a href="<?php echo $url ?>" target="_blank" rel="noopener nofollow" inline-class="image-a">
39
+ <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">
40
+ </a>
41
+ </td>
42
+ </tr>
43
+ </table>
44
+
45
+ <table width="49%" align="right" class="hero-table hero-table-right" border="0" cellspacing="0" cellpadding="0">
46
+ <tr>
47
+ <td align="center" inline-class="title">
48
+ <span><?php echo $options['title'] ?></span>
49
+ </td>
50
+ </tr>
51
+ <tr>
52
+ <td align="center" inline-class="text">
53
+ <span><?php echo $options['text'] ?></span>
54
+ </td>
55
+ </tr>
56
+
57
+ <tr>
58
+ <td align="center" inline-class="button">
59
+ <?php echo tnpc_button($options) ?>
60
+ </td>
61
+ </tr>
62
+
63
+ </table>
emails/blocks/hero/block-right.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style>
2
+ /* Styles which will be removed and injected in the replacing the matching "inline-class" attribute */
3
+ .title {
4
+ font-size: <?php echo $title_font_size ?>px;
5
+ color: <?php echo $title_font_color ?>;
6
+ padding-top: 0;
7
+ font-family: <?php echo $title_font_family ?>;
8
+ font-weight: <?php echo $title_font_weight ?>;
9
+ line-height: normal;
10
+ margin: 0;
11
+ text-align: center;
12
+ }
13
+ .text {
14
+ padding: 20px 0 0 0;
15
+ font-size: <?php echo $font_size ?>px;
16
+ line-height: 150%;
17
+ color: <?php echo $font_color ?>;
18
+ font-family: <?php echo $font_family ?>;
19
+ font-weight: <?php echo $font_weight ?>;
20
+ text-align: center;
21
+ margin: 0;
22
+ }
23
+ .image {
24
+ max-width: 100%!important;
25
+ display: block;
26
+ }
27
+ .image-a {
28
+ display: block;
29
+ }
30
+ .button {
31
+ padding-top: 15px;
32
+ }
33
+ </style>
34
+
35
+ <table width="49%" align="left" class="hero-table hero-table-right" border="0" cellspacing="0" cellpadding="0">
36
+ <tr>
37
+ <td align="center" inline-class="title">
38
+ <?php echo $options['title'] ?>
39
+ </td>
40
+ </tr>
41
+ <tr>
42
+ <td align="center" inline-class="text">
43
+ <?php echo $options['text'] ?>
44
+ </td>
45
+ </tr>
46
+ <tr>
47
+ <td align="center" inline-class="button">
48
+ <?php echo tnpc_button($options) ?>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+
53
+
54
+ <table width="49%" align="right" class="hero-table" border="0" cellspacing="0" cellpadding="0">
55
+ <tr>
56
+ <td align="center" valign="top">
57
+ <a href="<?php echo $url ?>" target="_blank" rel="noopener nofollow" inline-class="image-a">
58
+ <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">
59
+ </a>
60
+ </td>
61
+ </tr>
62
+ </table>
emails/blocks/hero/block.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /*
3
  * Name: Hero
4
  * Section: content
@@ -28,10 +29,10 @@ $defaults = array(
28
  'button_font_size' => 20,
29
  'button_background' => '#256F9C',
30
  'layout' => 'full',
31
- 'block_padding_top'=>30,
32
- 'block_padding_bottom'=>30,
33
- 'block_padding_left'=>15,
34
- 'block_padding_right'=>15
35
  );
36
 
37
  $options = array_merge($defaults, $options);
@@ -44,7 +45,7 @@ if (!empty($options['schema'])) {
44
  $options['button_font_color'] = '#ffffff';
45
  $options['button_background'] = '#96969C';
46
  }
47
-
48
  if ($options['schema'] === 'bright') {
49
  $options['block_background'] = '#ffffff';
50
  $options['title_font_color'] = '#000000';
@@ -57,9 +58,9 @@ if (!empty($options['schema'])) {
57
  $layout = $options['layout'];
58
 
59
  if ($layout == 'full') {
60
- $options = array_merge(array('block_padding_left'=>0, 'block_padding_right'=>0), $options);
61
  } else {
62
- $options = array_merge(array('block_padding_left'=>15, 'block_padding_right'=>15), $options);
63
  }
64
  $url = $options['button_url'];
65
 
@@ -78,205 +79,24 @@ $layout = $options['layout'];
78
  if (!empty($options['image']['id'])) {
79
  if ($layout == 'full') {
80
  $media = tnp_resize($options['image']['id'], array(600, 0));
 
81
  } else {
82
  $media = tnp_resize($options['image']['id'], array(600, 0));
83
- $media->set_width(300-$options['block_padding_left']);
84
  }
85
  $media->alt = $options['title'];
86
  } else {
87
  $media = false;
88
  }
89
- ?>
90
-
91
- <?php if ($layout == 'full') { ?>
92
-
93
- <style>
94
- .hero-title {
95
- font-size: <?php echo $title_font_size ?>px;
96
- color: <?php echo $title_font_color ?>;
97
- font-family: <?php echo $title_font_family ?>;
98
- font-weight: <?php echo $title_font_weight ?>;
99
- }
100
- .hero-text {
101
- padding: 20px 0 0 0;
102
- font-size: <?php echo $font_size ?>px;
103
- line-height: 150%;
104
- color: <?php echo $font_color ?>;
105
- font-family: <?php echo $font_family ?>;
106
- }
107
- .hero-image {
108
- max-width: 100%!important;
109
- display: inline-block;
110
- border: 0px;
111
- }
112
- </style>
113
-
114
-
115
- <!-- HERO IMAGE -->
116
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
117
- <?php if ($media) { ?>
118
- <tr>
119
- <td class="padding-copy tnpc-row-edit" align="center" style="text-align: center; line-height: 0; padding-bottom: 20px;">
120
- <a href="<?php echo $url ?>" target="_blank" rel="noopener nofollow">
121
- <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="hero-image">
122
- </a>
123
- </td>
124
- </tr>
125
- <?php } ?>
126
- <tr>
127
- <td>
128
- <!-- COPY -->
129
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
130
- <tr>
131
- <td align="center" inline-class="hero-title">
132
- <span><?php echo $options['title'] ?></span>
133
- </td>
134
- </tr>
135
- <tr>
136
- <td align="center" inline-class="hero-text">
137
- <span><?php echo $options['text'] ?></span>
138
- </td>
139
- </tr>
140
-
141
- <tr>
142
- <td align="center">
143
- <br>
144
- <?php echo tnpc_button($options)?>
145
- </td>
146
- </tr>
147
- </table>
148
- </td>
149
- </tr>
150
- </table>
151
-
152
- <?php } ?>
153
-
154
- <?php if ($layout == 'left') { ?>
155
-
156
- <style>
157
- .hero-title {
158
- font-size: <?php echo $title_font_size ?>px;
159
- color: <?php echo $title_font_color ?>;
160
- padding-top: 0;
161
- font-family: <?php echo $title_font_family ?>;
162
- font-weight: <?php echo $title_font_weight ?>;
163
- }
164
- .hero-text {
165
- padding: 20px 0 0 0;
166
- font-size: <?php echo $font_size ?>px;
167
- line-height: 150%;
168
- color: <?php echo $font_color ?>;
169
- font-family: <?php echo $font_family ?>;
170
- font-weight: <?php echo $font_weight ?>;
171
- }
172
- </style>
173
-
174
- <table width="290" align="left" class="hero-table">
175
- <tr>
176
- <td align="center" valign="top">
177
- <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 ?>" style="max-width: 100%!important; height: auto!important; display: block;" class="img-max">
178
- </td>
179
- </tr>
180
- </table>
181
-
182
- <table width="290" align="right" class="hero-table hero-table-right">
183
- <tr>
184
- <td align="center" style="text-align: center">
185
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
186
- <tr>
187
- <td align="center" inline-class="hero-title">
188
- <span><?php echo $options['title'] ?></span>
189
- </td>
190
- </tr>
191
- <tr>
192
- <td align="center" inline-class="hero-text">
193
- <span><?php echo $options['text'] ?></span>
194
- </td>
195
- </tr>
196
- </table>
197
- <br>
198
- <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
199
- <tr>
200
- <td align="center" vertical-align="middle" style="font-size:0px;padding:10px 25px;word-break:break-word;">
201
-
202
- <?php echo tnpc_button($options)?>
203
- </td>
204
- </tr>
205
- </table>
206
-
207
-
208
- </td>
209
- </tr>
210
- </table>
211
-
212
-
213
- <?php } ?>
214
-
215
-
216
- <?php if ($layout == 'right') { ?>
217
-
218
- <style>
219
- .hero-title {
220
- font-size: <?php echo $title_font_size ?>px;
221
- color: <?php echo $title_font_color ?>;
222
- padding-top: 0;
223
- font-family: <?php echo $title_font_family ?>;
224
- font-weight: <?php echo $title_font_weight ?>;
225
- line-height: normal;
226
- margin: 0;
227
- }
228
- .hero-text {
229
- padding: 20px 0 0 0;
230
- font-size: <?php echo $font_size ?>px;
231
- line-height: 150%;
232
- color: <?php echo $font_color ?>;
233
- font-family: <?php echo $font_family ?>;
234
- font-weight: <?php echo $font_weight ?>;
235
- }
236
- .image {
237
- max-width: 100%!important;
238
- display: block;
239
- }
240
- </style>
241
-
242
- <table width="48%" align="left" class="hero-table hero-table-right">
243
- <tr>
244
- <td align="center" style="text-align: center">
245
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
246
- <tr>
247
- <td align="center" inline-class="hero-title">
248
- <span><?php echo $options['title'] ?></span>
249
- </td>
250
- </tr>
251
- <tr>
252
- <td align="center" inline-class="hero-text">
253
- <span><?php echo $options['text'] ?></span>
254
- </td>
255
- </tr>
256
- </table>
257
- <br>
258
- <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
259
- <tr>
260
- <td align="center" vertical-align="middle" style="font-size:0px;padding:10px 25px;word-break:break-word;">
261
-
262
- <?php echo tnpc_button($options)?>
263
- </td>
264
- </tr>
265
- </table>
266
-
267
-
268
- </td>
269
- </tr>
270
- </table>
271
-
272
- <table width="48%" align="right" class="hero-table">
273
- <tr>
274
- <td align="center" valign="top">
275
- <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">
276
- </td>
277
- </tr>
278
- </table>
279
-
280
-
281
- <?php } ?>
282
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+
3
  /*
4
  * Name: Hero
5
  * Section: content
29
  'button_font_size' => 20,
30
  'button_background' => '#256F9C',
31
  'layout' => 'full',
32
+ 'block_padding_top' => 30,
33
+ 'block_padding_bottom' => 30,
34
+ 'block_padding_left' => 15,
35
+ 'block_padding_right' => 15
36
  );
37
 
38
  $options = array_merge($defaults, $options);
45
  $options['button_font_color'] = '#ffffff';
46
  $options['button_background'] = '#96969C';
47
  }
48
+
49
  if ($options['schema'] === 'bright') {
50
  $options['block_background'] = '#ffffff';
51
  $options['title_font_color'] = '#000000';
58
  $layout = $options['layout'];
59
 
60
  if ($layout == 'full') {
61
+ $options = array_merge(array('block_padding_left' => 0, 'block_padding_right' => 0), $options);
62
  } else {
63
+ $options = array_merge(array('block_padding_left' => 15, 'block_padding_right' => 15), $options);
64
  }
65
  $url = $options['button_url'];
66
 
79
  if (!empty($options['image']['id'])) {
80
  if ($layout == 'full') {
81
  $media = tnp_resize($options['image']['id'], array(600, 0));
82
+ $media->set_width(600 - $options['block_padding_left'] - $options['block_padding_right']);
83
  } else {
84
  $media = tnp_resize($options['image']['id'], array(600, 0));
85
+ $media->set_width(300 - $options['block_padding_left']);
86
  }
87
  $media->alt = $options['title'];
88
  } else {
89
  $media = false;
90
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
+ switch ($layout) {
93
+ case 'left':
94
+ include __DIR__ . '/block-left.php';
95
+ return;
96
+ case 'right':
97
+ include __DIR__ . '/block-right.php';
98
+ return;
99
+ case 'full':
100
+ include __DIR__ . '/block-full.php';
101
+ return;
102
+ }
emails/blocks/posts/block.php CHANGED
@@ -113,7 +113,6 @@ $alternative = plugins_url('newsletter') . '/emails/blocks/posts/images/blank.pn
113
  $alternative_2 = plugins_url('newsletter') . '/emails/blocks/posts/images/blank-240x160.png';
114
 
115
  remove_all_filters('excerpt_more');
116
-
117
  ?>
118
 
119
  <?php if (!$posts) { ?>
@@ -192,7 +191,8 @@ remove_all_filters('excerpt_more');
192
  $media = null;
193
  if ($show_image) {
194
  $media = tnp_composer_block_posts_get_media($post, ['width' => 300, 'height' => 0]);
195
- if ($media) $media->set_width(105);
 
196
  }
197
  ?>
198
 
@@ -201,7 +201,7 @@ remove_all_filters('excerpt_more');
201
  <td valign="top" style="padding: 20px 0 0 0;" class="posts-td-1">
202
 
203
  <?php if ($media) { ?>
204
- <table width="20%" cellpadding="0" cellspacing="0" border="0" align="left" class="posts-1-column" style="margin-bottom: 20px">
205
  <tr>
206
  <td>
207
  <a href="<?php echo tnp_post_permalink($post) ?>" target="_blank">
@@ -216,68 +216,66 @@ remove_all_filters('excerpt_more');
216
  </td>
217
  </tr>
218
  </table>
 
219
 
220
-
221
- <?php } ?>
 
222
 
223
- <table width="<?php echo $media?'78%':'100%'?>" cellpadding="0" cellspacing="0" border="0" class="posts-1-column" align="right">
224
- <tr>
225
- <td>
226
-
227
- <!-- ARTICLE -->
228
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
229
- <?php if (!empty($options['show_date'])) { ?>
230
- <tr>
231
- <td align="left" inline-class="posts-post-date">
232
- <?php echo tnp_post_date($post) ?>
233
- </td>
234
- </tr>
235
- <?php } ?>
236
- <tr>
237
- <td align="left"
238
- inline-class="posts-post-title"
239
- class="tnpc-row-edit tnpc-inline-editable"
240
- data-type="title" data-id="<?php echo $post->ID ?>">
241
- <?php
242
- echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'title', $post->ID) ?
243
- TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'title', $post->ID) :
244
- tnp_post_title($post)
245
- ?>
246
- </td>
247
- </tr>
248
- <tr>
249
- <td align="left"
250
- inline-class="posts-post-excerpt"
251
- class="padding-copy tnpc-row-edit tnpc-inline-editable"
252
- data-type="text" data-id="<?php echo $post->ID ?>">
253
- <?php
254
- echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $post->ID) ?
255
- TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $post->ID) :
256
- tnp_post_excerpt($post, $excerpt_length)
257
- ?>
258
- </td>
259
- </tr>
260
- <tr>
261
- <td align="left" class="padding">
262
- <table border="0" cellpadding="0" cellspacing="0" inline-class="posts-button-table" align="right">
263
  <tr>
264
- <td align="center" valign="middle" inline-class="posts-button-td">
265
- <a href="<?php echo esc_attr($url) ?>" target="_blank" inline-class="posts-button-a"><?php echo $button_label ?></a>
266
  </td>
267
  </tr>
268
- </table>
269
- </td>
270
- </tr>
271
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
 
273
- </td>
274
- </tr>
275
- </table>
276
 
277
- </td>
278
- </tr>
279
 
280
- <?php } ?>
281
 
282
  </table>
283
 
@@ -338,7 +336,7 @@ remove_all_filters('excerpt_more');
338
 
339
  <!-- TWO COLUMNS -->
340
  <table cellspacing="0" cellpadding="0" border="0" width="100%">
341
- <?php foreach (array_chunk($posts, 2) AS $row) { ?>
342
  <tr>
343
  <td valign="top" style="padding: 10px;" class="mobile-wrapper two-columns">
344
 
@@ -364,7 +362,7 @@ remove_all_filters('excerpt_more');
364
  </a>
365
  </td>
366
  </tr>
367
- <?php } ?>
368
  <tr>
369
  <td align="center"
370
  inline-class="posts-post-title"
@@ -377,13 +375,13 @@ remove_all_filters('excerpt_more');
377
  ?>
378
  </td>
379
  </tr>
380
- <?php if (!empty($options['show_date'])) { ?>
381
  <tr>
382
  <td align="center" inline-class="posts-post-date">
383
- <?php echo tnp_post_date($row[0]) ?>
384
  </td>
385
  </tr>
386
- <?php } ?>
387
  <tr>
388
  <td align="center"
389
  inline-class="posts-post-excerpt"
@@ -413,7 +411,7 @@ remove_all_filters('excerpt_more');
413
  </tr>
414
  </table>
415
 
416
- <?php if (!empty($row[1])) { ?>
417
  <!-- RIGHT COLUMN -->
418
  <table cellpadding="0" cellspacing="0" border="0" width="47%" align="right" class="responsive-table">
419
  <tr>
@@ -434,7 +432,7 @@ remove_all_filters('excerpt_more');
434
  </a>
435
  </td>
436
  </tr>
437
- <?php } ?>
438
  <tr>
439
  <td align="center"
440
  inline-class="posts-post-title"
@@ -447,13 +445,13 @@ remove_all_filters('excerpt_more');
447
  ?>
448
  </td>
449
  </tr>
450
- <?php if (!empty($options['show_date'])) { ?>
451
  <tr>
452
  <td align="center" inline-class="posts-post-date">
453
- <?php echo tnp_post_date($row[1]) ?>
454
  </td>
455
  </tr>
456
- <?php } ?>
457
  <tr>
458
  <td align="center"
459
  inline-class="posts-post-excerpt"
@@ -482,12 +480,12 @@ remove_all_filters('excerpt_more');
482
  </td>
483
  </tr>
484
  </table>
485
- <?php } ?>
486
 
487
  </td>
488
  </tr>
489
 
490
- <?php } ?>
491
 
492
  </table>
493
 
113
  $alternative_2 = plugins_url('newsletter') . '/emails/blocks/posts/images/blank-240x160.png';
114
 
115
  remove_all_filters('excerpt_more');
 
116
  ?>
117
 
118
  <?php if (!$posts) { ?>
191
  $media = null;
192
  if ($show_image) {
193
  $media = tnp_composer_block_posts_get_media($post, ['width' => 300, 'height' => 0]);
194
+ if ($media)
195
+ $media->set_width(105);
196
  }
197
  ?>
198
 
201
  <td valign="top" style="padding: 20px 0 0 0;" class="posts-td-1">
202
 
203
  <?php if ($media) { ?>
204
+ <table width="20%" cellpadding="0" cellspacing="0" border="0" align="left" class="posts-1-column" style="margin-bottom: 20px">
205
  <tr>
206
  <td>
207
  <a href="<?php echo tnp_post_permalink($post) ?>" target="_blank">
216
  </td>
217
  </tr>
218
  </table>
219
+ <?php } ?>
220
 
221
+ <table width="<?php echo $media ? '78%' : '100%' ?>" cellpadding="0" cellspacing="0" border="0" class="posts-1-column" align="right">
222
+ <tr>
223
+ <td>
224
 
225
+ <!-- ARTICLE -->
226
+ <table border="0" cellspacing="0" cellpadding="0" width="100%">
227
+ <?php if (!empty($options['show_date'])) { ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  <tr>
229
+ <td align="left" inline-class="posts-post-date">
230
+ <?php echo tnp_post_date($post) ?>
231
  </td>
232
  </tr>
233
+ <?php } ?>
234
+ <tr>
235
+ <td align="left"
236
+ inline-class="posts-post-title"
237
+ class="tnpc-row-edit tnpc-inline-editable"
238
+ data-type="title" data-id="<?php echo $post->ID ?>">
239
+ <?php
240
+ echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'title', $post->ID) ?
241
+ TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'title', $post->ID) :
242
+ tnp_post_title($post)
243
+ ?>
244
+ </td>
245
+ </tr>
246
+ <tr>
247
+ <td align="left"
248
+ inline-class="posts-post-excerpt"
249
+ class="padding-copy tnpc-row-edit tnpc-inline-editable"
250
+ data-type="text" data-id="<?php echo $post->ID ?>">
251
+ <?php
252
+ echo TNP_Composer::is_post_field_edited_inline($options['inline_edits'], 'text', $post->ID) ?
253
+ TNP_Composer::get_edited_inline_post_field($options['inline_edits'], 'text', $post->ID) :
254
+ tnp_post_excerpt($post, $excerpt_length)
255
+ ?>
256
+ </td>
257
+ </tr>
258
+ <tr>
259
+ <td align="left" class="padding">
260
+ <table border="0" cellpadding="0" cellspacing="0" inline-class="posts-button-table" align="right">
261
+ <tr>
262
+ <td align="center" valign="middle" inline-class="posts-button-td">
263
+ <a href="<?php echo esc_attr($url) ?>" target="_blank" inline-class="posts-button-a"><?php echo $button_label ?></a>
264
+ </td>
265
+ </tr>
266
+ </table>
267
+ </td>
268
+ </tr>
269
+ </table>
270
 
271
+ </td>
272
+ </tr>
273
+ </table>
274
 
275
+ </td>
276
+ </tr>
277
 
278
+ <?php } ?>
279
 
280
  </table>
281
 
336
 
337
  <!-- TWO COLUMNS -->
338
  <table cellspacing="0" cellpadding="0" border="0" width="100%">
339
+ <?php foreach (array_chunk($posts, 2) AS $row) { ?>
340
  <tr>
341
  <td valign="top" style="padding: 10px;" class="mobile-wrapper two-columns">
342
 
362
  </a>
363
  </td>
364
  </tr>
365
+ <?php } ?>
366
  <tr>
367
  <td align="center"
368
  inline-class="posts-post-title"
375
  ?>
376
  </td>
377
  </tr>
378
+ <?php if (!empty($options['show_date'])) { ?>
379
  <tr>
380
  <td align="center" inline-class="posts-post-date">
381
+ <?php echo tnp_post_date($row[0]) ?>
382
  </td>
383
  </tr>
384
+ <?php } ?>
385
  <tr>
386
  <td align="center"
387
  inline-class="posts-post-excerpt"
411
  </tr>
412
  </table>
413
 
414
+ <?php if (!empty($row[1])) { ?>
415
  <!-- RIGHT COLUMN -->
416
  <table cellpadding="0" cellspacing="0" border="0" width="47%" align="right" class="responsive-table">
417
  <tr>
432
  </a>
433
  </td>
434
  </tr>
435
+ <?php } ?>
436
  <tr>
437
  <td align="center"
438
  inline-class="posts-post-title"
445
  ?>
446
  </td>
447
  </tr>
448
+ <?php if (!empty($options['show_date'])) { ?>
449
  <tr>
450
  <td align="center" inline-class="posts-post-date">
451
+ <?php echo tnp_post_date($row[1]) ?>
452
  </td>
453
  </tr>
454
+ <?php } ?>
455
  <tr>
456
  <td align="center"
457
  inline-class="posts-post-excerpt"
480
  </td>
481
  </tr>
482
  </table>
483
+ <?php } ?>
484
 
485
  </td>
486
  </tr>
487
 
488
+ <?php } ?>
489
 
490
  </table>
491
 
emails/blocks/posts/options.php CHANGED
@@ -27,7 +27,7 @@
27
  <?php $fields->font('font', __('Excerpt font', 'newsletter')) ?>
28
 
29
  <div class="tnp-field">
30
- <label class="tnp-label"><?php _e('Dates and images', 'newsletter')?></div>
31
  <div class="tnp-field-row">
32
  <div class="tnp-field-col-2">
33
  <?php $fields->checkbox('show_image', __('Show image', 'newsletter')) ?>
27
  <?php $fields->font('font', __('Excerpt font', 'newsletter')) ?>
28
 
29
  <div class="tnp-field">
30
+ <label class="tnp-label"><?php _e('Dates and images', 'newsletter')?></label>
31
  <div class="tnp-field-row">
32
  <div class="tnp-field-col-2">
33
  <?php $fields->checkbox('show_image', __('Show image', 'newsletter')) ?>
emails/tnp-composer/css/newsletter.css CHANGED
@@ -17,6 +17,15 @@ img.aligncenter{display:block;margin:0 auto;}
17
  width:100% !important;
18
  }
19
 
 
 
 
 
 
 
 
 
 
20
  /* ADJUSTS LAYOUT OF LOGO IMAGE */
21
  td[class="logo"]{
22
  text-align: left;
17
  width:100% !important;
18
  }
19
 
20
+ table[class="mobile-full-width"] {
21
+ width:100% !important;
22
+ }
23
+
24
+ img[class="mobile-full-width"] {
25
+ width:100% !important;
26
+ display: block;
27
+ }
28
+
29
  /* ADJUSTS LAYOUT OF LOGO IMAGE */
30
  td[class="logo"]{
31
  text-align: left;
includes/module.php CHANGED
@@ -756,7 +756,7 @@ class NewsletterModule {
756
  }
757
 
758
  /**
759
- *
760
  * @global wpdb $wpdb
761
  * @param int|array $id
762
  * @return boolean
756
  }
757
 
758
  /**
759
+ * Delete one or more emails identified by ID (single value or array of ID)
760
  * @global wpdb $wpdb
761
  * @param int|array $id
762
  * @return boolean
includes/store.php CHANGED
@@ -182,6 +182,7 @@ class NewsletterStore {
182
  */
183
  function delete($table, $id) {
184
  global $wpdb;
 
185
  if (is_array($id)) {
186
  for ($i=0; $i<count($id); $i++) {
187
  $id[$i] = (int)$id[$i];
182
  */
183
  function delete($table, $id) {
184
  global $wpdb;
185
+ if (empty($id)) return false;
186
  if (is_array($id)) {
187
  for ($i=0; $i<count($id); $i++) {
188
  $id[$i] = (int)$id[$i];
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.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,7 +35,7 @@ if (version_compare(phpversion(), '5.6', '<')) {
35
  return;
36
  }
37
 
38
- define('NEWSLETTER_VERSION', '6.6.0');
39
 
40
  global $newsletter, $wpdb;
41
 
@@ -777,7 +777,7 @@ class Newsletter extends NewsletterModule {
777
 
778
  $message->to = $user->email;
779
 
780
- $message->headers = array('List-Unsubscribe' => '<' . $this->build_action_url('u', $user, $email) . '>');
781
  $message->headers['Precedence'] = 'bulk';
782
  $message->headers['X-Newsletter-Email-Id'] = $email->id;
783
  $message->headers['X-Auto-Response-Suppress'] = 'OOF, AutoReply';
@@ -1204,7 +1204,7 @@ class Newsletter extends NewsletterModule {
1204
  $this->newsletter_page_url = get_permalink($this->options['page']);
1205
  if ($language && $this->newsletter_page_url) {
1206
  if (class_exists('SitePress')) {
1207
- $this->newsletter_page_url = apply_filters('wpml_permalink', $this->newsletter_page_url, $language);
1208
  }
1209
  if (function_exists('pll_get_post')) {
1210
  $this->newsletter_page_url = get_permalink(pll_get_post($this->options['page']));
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.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.
35
  return;
36
  }
37
 
38
+ define('NEWSLETTER_VERSION', '6.6.2');
39
 
40
  global $newsletter, $wpdb;
41
 
777
 
778
  $message->to = $user->email;
779
 
780
+ $message->headers = [];
781
  $message->headers['Precedence'] = 'bulk';
782
  $message->headers['X-Newsletter-Email-Id'] = $email->id;
783
  $message->headers['X-Auto-Response-Suppress'] = 'OOF, AutoReply';
1204
  $this->newsletter_page_url = get_permalink($this->options['page']);
1205
  if ($language && $this->newsletter_page_url) {
1206
  if (class_exists('SitePress')) {
1207
+ $this->newsletter_page_url = apply_filters('wpml_permalink', $this->newsletter_page_url, $language, true);
1208
  }
1209
  if (function_exists('pll_get_post')) {
1210
  $this->newsletter_page_url = get_permalink(pll_get_post($this->options['page']));
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
5
- Stable tag: 6.6.0
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
 
@@ -109,6 +109,16 @@ Thank you, The Newsletter Team
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
 
 
 
 
 
112
  = 6.6.0 =
113
 
114
  * Fixed a jQuery bug on drag and drop composer
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
5
+ Stable tag: 6.6.2
6
  Requires PHP: 5.6
7
  Contributors: satollo,webagile,michael-travan
8
 
109
 
110
  == Changelog ==
111
 
112
+ = 6.6.2 =
113
+
114
+ * Fixed incomplete blocks package on previous release
115
+
116
+ = 6.6.1 =
117
+
118
+ * Improved WMPL permalink filter (not working with custom slugs and old WPML releases)
119
+ * Fixed the hero block not rendering correctly with "left" layout
120
+ * Added the one-click list unsubscribe header
121
+
122
  = 6.6.0 =
123
 
124
  * Fixed a jQuery bug on drag and drop composer
unsubscription/index.php CHANGED
@@ -39,8 +39,8 @@ if (!$controls->is_action()) {
39
 
40
  <div id="tnp-heading">
41
 
42
- <h2><?php _e('Cancellation', 'newsletter')?></h2>
43
- <?php $controls->panel_help('https://www.thenewsletterplugin.com/documentation/cancellation')?>
44
 
45
  </div>
46
 
@@ -48,7 +48,7 @@ if (!$controls->is_action()) {
48
 
49
  <form method="post" action="">
50
  <?php $controls->init(); ?>
51
- <p>
52
  <?php $controls->button_save() ?>
53
  <?php $controls->button_reset() ?>
54
  </p>
@@ -60,16 +60,10 @@ if (!$controls->is_action()) {
60
  </ul>
61
  <div id="tabs-cancellation">
62
  <table class="form-table">
63
- <tr>
64
- <th><?php _e('Notify admin on unsubscription', 'newsletter') ?></th>
65
- <td>
66
- <?php $controls->yesno('notify_admin_on_unsubscription'); ?>
67
- </td>
68
- </tr>
69
  <tr>
70
  <th><?php _e('Cancellation message', 'newsletter') ?></th>
71
  <td>
72
- <?php $controls->wp_editor('unsubscribe_text', array('editor_height'=>250)); ?>
73
  <p class="description">
74
  </p>
75
  </td>
@@ -78,7 +72,7 @@ if (!$controls->is_action()) {
78
  <tr>
79
  <th><?php _e('Goodbye message', 'newsletter') ?></th>
80
  <td>
81
- <?php $controls->wp_editor('unsubscribed_text', array('editor_height'=>250)); ?>
82
  <p class="description">
83
  </p>
84
  </td>
@@ -87,21 +81,44 @@ if (!$controls->is_action()) {
87
  <tr>
88
  <th><?php _e('Goodbye email', 'newsletter') ?></th>
89
  <td>
90
- <?php $controls->email('unsubscribed', 'wordpress', $is_all_languages, array('editor_height'=>250)); ?>
91
  <p class="description">
92
 
93
  </p>
94
  </td>
95
  </tr>
96
  <tr>
97
- <th><?php _e('On error', 'newsletter')?></th>
98
  <td>
99
- <?php $controls->wp_editor('error_text', array('editor_height'=>150)); ?>
100
  <p class="description">
101
 
102
  </p>
103
  </td>
104
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  </table>
106
  </div>
107
 
@@ -110,7 +127,7 @@ if (!$controls->is_action()) {
110
  <tr>
111
  <th><?php _e('Reactivated message', 'newsletter') ?></th>
112
  <td>
113
- <?php $controls->wp_editor('reactivated_text', array('editor_height'=>250)); ?>
114
  <p class="description">
115
  </p>
116
  </td>
39
 
40
  <div id="tnp-heading">
41
 
42
+ <h2><?php _e('Cancellation', 'newsletter') ?></h2>
43
+ <?php $controls->panel_help('https://www.thenewsletterplugin.com/documentation/cancellation') ?>
44
 
45
  </div>
46
 
48
 
49
  <form method="post" action="">
50
  <?php $controls->init(); ?>
51
+ <p>
52
  <?php $controls->button_save() ?>
53
  <?php $controls->button_reset() ?>
54
  </p>
60
  </ul>
61
  <div id="tabs-cancellation">
62
  <table class="form-table">
 
 
 
 
 
 
63
  <tr>
64
  <th><?php _e('Cancellation message', 'newsletter') ?></th>
65
  <td>
66
+ <?php $controls->wp_editor('unsubscribe_text', array('editor_height' => 250)); ?>
67
  <p class="description">
68
  </p>
69
  </td>
72
  <tr>
73
  <th><?php _e('Goodbye message', 'newsletter') ?></th>
74
  <td>
75
+ <?php $controls->wp_editor('unsubscribed_text', array('editor_height' => 250)); ?>
76
  <p class="description">
77
  </p>
78
  </td>
81
  <tr>
82
  <th><?php _e('Goodbye email', 'newsletter') ?></th>
83
  <td>
84
+ <?php $controls->email('unsubscribed', 'wordpress', $is_all_languages, array('editor_height' => 250)); ?>
85
  <p class="description">
86
 
87
  </p>
88
  </td>
89
  </tr>
90
  <tr>
91
+ <th><?php _e('On error', 'newsletter') ?></th>
92
  <td>
93
+ <?php $controls->wp_editor('error_text', array('editor_height' => 150)); ?>
94
  <p class="description">
95
 
96
  </p>
97
  </td>
98
  </tr>
99
+
100
+ <tr>
101
+ <th><?php _e('Cancellation requests via email', 'newsletter') ?></th>
102
+ <td>
103
+ <?php $controls->text_email('list_unsubscribe_mailto_header'); ?>
104
+ <p class="description">
105
+ <i class="fas fa-exclamation-triangle"></i> <a href="https://www.thenewsletterplugin.com/documentation/subscribers-and-management/cancellation/#list-unsubscribe" target="_blank"><?php _e('Read more', 'newsletter') ?></a>
106
+ </p>
107
+ </td>
108
+ </tr>
109
+ <tr>
110
+ <th><?php _e('Disable unsubscribe headers', 'newsletter') ?></th>
111
+ <td>
112
+ <?php $controls->yesno('disable_unsubscribe_headers'); ?>
113
+ <?php $controls->field_help('https://www.thenewsletterplugin.com/documentation/subscribers-and-management/cancellation/#list-unsubscribe') ?>
114
+ </td>
115
+ </tr>
116
+ <tr>
117
+ <th><?php _e('Notify admin on unsubscription', 'newsletter') ?></th>
118
+ <td>
119
+ <?php $controls->yesno('notify_admin_on_unsubscription'); ?>
120
+ </td>
121
+ </tr>
122
  </table>
123
  </div>
124
 
127
  <tr>
128
  <th><?php _e('Reactivated message', 'newsletter') ?></th>
129
  <td>
130
+ <?php $controls->wp_editor('reactivated_text', array('editor_height' => 250)); ?>
131
  <p class="description">
132
  </p>
133
  </td>
unsubscription/unsubscription.php CHANGED
@@ -17,9 +17,12 @@ class NewsletterUnsubscription extends NewsletterModule {
17
  }
18
 
19
  function __construct() {
20
- parent::__construct('unsubscription', '1.0.1');
 
21
  add_filter('newsletter_replace', array($this, 'hook_newsletter_replace'), 10, 3);
22
  add_filter('newsletter_page_text', array($this, 'hook_newsletter_page_text'), 10, 3);
 
 
23
  add_action('newsletter_action', array($this, 'hook_newsletter_action'));
24
  }
25
 
@@ -54,6 +57,13 @@ class NewsletterUnsubscription extends NewsletterModule {
54
  die();
55
  break;
56
 
 
 
 
 
 
 
 
57
  case 'reactivate':
58
  if ($this->antibot_form_check()) {
59
  $user = $this->reactivate();
@@ -112,19 +122,18 @@ class NewsletterUnsubscription extends NewsletterModule {
112
  return NewsletterSubscription::instance()->mail($user, $subject, $message);
113
  }
114
 
115
- function notify_admin_on_unsubscription( $user ) {
116
-
117
- if ( empty( $this->options['notify_admin_on_unsubscription'] ) ) {
118
- return;
119
- }
120
 
121
- $message = $this->generate_admin_notification_message( $user );
122
- $email = trim( get_option( 'admin_email' ) );
123
- $subject = $this->generate_admin_notification_subject( 'Newsletter unsubscription' );
124
 
125
- Newsletter::instance()->mail( $email, $subject, array( 'text' => $message ) );
 
 
126
 
127
- }
 
128
 
129
  /**
130
  * Reactivate the subscriber extracted from the request setting his status
@@ -207,6 +216,44 @@ class NewsletterUnsubscription extends NewsletterModule {
207
  $this->add_admin_page('index', 'Unsubscribe');
208
  }
209
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  }
211
 
212
  NewsletterUnsubscription::instance();
17
  }
18
 
19
  function __construct() {
20
+ parent::__construct('unsubscription', '1.0.2');
21
+
22
  add_filter('newsletter_replace', array($this, 'hook_newsletter_replace'), 10, 3);
23
  add_filter('newsletter_page_text', array($this, 'hook_newsletter_page_text'), 10, 3);
24
+ add_filter('newsletter_message_headers', array($this, 'hook_add_unsubscribe_headers_to_email'), 10, 3);
25
+
26
  add_action('newsletter_action', array($this, 'hook_newsletter_action'));
27
  }
28
 
57
  die();
58
  break;
59
 
60
+ case 'lu': //List Unsubscribe - action from oneclick unsubscribe header
61
+ if ($this->one_click_list_unsubscribe_check()) {
62
+ $this->unsubscribe();
63
+ }
64
+ die();
65
+ break;
66
+
67
  case 'reactivate':
68
  if ($this->antibot_form_check()) {
69
  $user = $this->reactivate();
122
  return NewsletterSubscription::instance()->mail($user, $subject, $message);
123
  }
124
 
125
+ function notify_admin_on_unsubscription($user) {
 
 
 
 
126
 
127
+ if (empty($this->options['notify_admin_on_unsubscription'])) {
128
+ return;
129
+ }
130
 
131
+ $message = $this->generate_admin_notification_message($user);
132
+ $email = trim(get_option('admin_email'));
133
+ $subject = $this->generate_admin_notification_subject('Newsletter unsubscription');
134
 
135
+ Newsletter::instance()->mail($email, $subject, array('text' => $message));
136
+ }
137
 
138
  /**
139
  * Reactivate the subscriber extracted from the request setting his status
216
  $this->add_admin_page('index', 'Unsubscribe');
217
  }
218
 
219
+ /**
220
+ * @param array $headers
221
+ * @param TNP_Email $email
222
+ * @param TNP_User $user
223
+ *
224
+ * @return array
225
+ */
226
+ function hook_add_unsubscribe_headers_to_email($headers, $email, $user) {
227
+
228
+ if (isset($this->options['disable_unsubscribe_headers']) && $this->options['disable_unsubscribe_headers'] == 1) {
229
+ return $headers;
230
+ }
231
+
232
+ $list_unsubscribe_values = [];
233
+ if (!empty($this->options['list_unsubscribe_mailto_header'])) {
234
+ $unsubscribe_address = $this->options['list_unsubscribe_mailto_header'];
235
+ $list_unsubscribe_values[] = "<mailto:$unsubscribe_address?subject=unsubscribe>";
236
+ }
237
+
238
+ $unsubscribe_action_url = $this->build_action_url('lu', $user, $email);
239
+ $list_unsubscribe_values[] = "<$unsubscribe_action_url>";
240
+
241
+ $headers['List-Unsubscribe-Post'] = 'List-Unsubscribe=One-Click';
242
+ $headers['List-Unsubscribe'] = implode(', ', $list_unsubscribe_values);
243
+ return $headers;
244
+ }
245
+
246
+ /**
247
+ * @return bool
248
+ */
249
+ function one_click_list_unsubscribe_check() {
250
+ if (isset($_POST['List-Unsubscribe']) && 'One-Click' === $_POST['List-Unsubscribe'] || 'List-Unsubscribe=One-Click' === file_get_contents('php://input')) {
251
+ return true;
252
+ }
253
+
254
+ return false;
255
+ }
256
+
257
  }
258
 
259
  NewsletterUnsubscription::instance();