Version Description
Download this release
Release Info
Developer | satollo |
Plugin | Newsletter |
Version | 5.8.7 |
Comparing to | |
See all releases |
Code changes from version 5.8.6 to 5.8.7
- emails/blocks/giphy/options.php +19 -18
- emails/blocks/hero/block.php +6 -2
- emails/blocks/hero/options.php +3 -3
- emails/blocks/preheader/block.php +12 -3
- emails/blocks/preheader/options.php +6 -0
- emails/tnp-composer/_css/newsletter-builder.css +16 -11
- emails/tnp-composer/edit.php +12 -8
- includes/controls.php +24 -19
- plugin.php +2 -2
- profile/profile.php +5 -3
- readme.txt +11 -2
- subscription/options.php +2 -2
- subscription/subscription.php +17 -8
- unsubscription/unsubscription.php +1 -1
emails/blocks/giphy/options.php
CHANGED
@@ -9,25 +9,21 @@
|
|
9 |
<tr>
|
10 |
<th><?php _e('Search Giphy', 'newsletter') ?></th>
|
11 |
<td>
|
12 |
-
<?php $controls->text('q') ?>
|
13 |
-
|
14 |
-
|
15 |
-
<tr>
|
16 |
-
<th><?php _e('Choose', 'newsletter') ?></th>
|
17 |
-
<td>
|
18 |
-
<div style="clear: both" id="tnp-giphy-results">Write something in the search above</div>
|
19 |
</td>
|
20 |
</tr>
|
21 |
<tr>
|
22 |
<th><?php _e('Selected', 'newsletter') ?></th>
|
23 |
<td>
|
24 |
-
<?php $controls->
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
</td>
|
32 |
</tr>
|
33 |
<tr>
|
@@ -47,9 +43,9 @@
|
|
47 |
<script type="text/javascript">
|
48 |
|
49 |
function choose_gif(url) {
|
50 |
-
jQuery("#tnp-giphy-results").html("");
|
51 |
jQuery("#options-giphy_url").val(url);
|
52 |
-
jQuery("#giphy-preview").html('<img src="' + url + '"
|
53 |
}
|
54 |
|
55 |
jQuery("#options-q").keyup(
|
@@ -58,13 +54,18 @@
|
|
58 |
window.clearTimeout(tid);
|
59 |
}
|
60 |
tid = window.setTimeout(function () {
|
61 |
-
|
|
|
|
|
|
|
|
|
62 |
jQuery("#tnp-giphy-results").html("");
|
63 |
jQuery.each(data.data, function (index, value) {
|
64 |
-
jQuery("#tnp-giphy-results").append('<img src="' + value.images.fixed_width_small.url + '" onclick="choose_gif(\'' + value.images.fixed_height.url + '\')" style="float:left;"
|
65 |
});
|
66 |
}, "json");
|
67 |
}, 500);
|
68 |
});
|
|
|
69 |
|
70 |
</script>
|
9 |
<tr>
|
10 |
<th><?php _e('Search Giphy', 'newsletter') ?></th>
|
11 |
<td>
|
12 |
+
<?php $controls->text('q', 40, 'Search a picture...') ?>
|
13 |
+
<br>
|
14 |
+
<div style="clear: both; max-height: 300px; overflow: scroll" id="tnp-giphy-results"></div>
|
|
|
|
|
|
|
|
|
15 |
</td>
|
16 |
</tr>
|
17 |
<tr>
|
18 |
<th><?php _e('Selected', 'newsletter') ?></th>
|
19 |
<td>
|
20 |
+
<?php $controls->hidden('giphy_url') ?>
|
21 |
+
<br>
|
22 |
+
<div id="giphy-preview">
|
23 |
+
<?php if (!empty($controls->data['giphy_url'])) { ?>
|
24 |
+
<img src="<?php echo esc_attr($controls->data['giphy_url'])?>" style="max-width: 300px">
|
25 |
+
<?php } ?>
|
26 |
+
</div>
|
27 |
</td>
|
28 |
</tr>
|
29 |
<tr>
|
43 |
<script type="text/javascript">
|
44 |
|
45 |
function choose_gif(url) {
|
46 |
+
//jQuery("#tnp-giphy-results").html("");
|
47 |
jQuery("#options-giphy_url").val(url);
|
48 |
+
jQuery("#giphy-preview").html('<img src="' + url + '" style="max-width: 300px">');
|
49 |
}
|
50 |
|
51 |
jQuery("#options-q").keyup(
|
54 |
window.clearTimeout(tid);
|
55 |
}
|
56 |
tid = window.setTimeout(function () {
|
57 |
+
var rating = "r";
|
58 |
+
var limit = 20;
|
59 |
+
var offset = 0;
|
60 |
+
|
61 |
+
jQuery.get("https://api.giphy.com/v1/gifs/search", {limit: limit, rating: rating, api_key: "57FLbVJJd7oQBZ0fEiRnzhM2VtZp5OP1", q: jQuery("#options-q").val()}, function (data) {
|
62 |
jQuery("#tnp-giphy-results").html("");
|
63 |
jQuery.each(data.data, function (index, value) {
|
64 |
+
jQuery("#tnp-giphy-results").append('<div style="overflow: hidden; width: 100px; height: 100px; float: left; margin: 5px"><img src="' + value.images.fixed_width_small.url + '" onclick="choose_gif(\'' + value.images.fixed_height.url + '\')" style="float:left; max-width: 100%"></div>');
|
65 |
});
|
66 |
}, "json");
|
67 |
}, 500);
|
68 |
});
|
69 |
+
jQuery("#options-q").trigger('keyup');
|
70 |
|
71 |
</script>
|
emails/blocks/hero/block.php
CHANGED
@@ -16,9 +16,11 @@ $defaults = array(
|
|
16 |
'font_family' => 'Helvetica, Arial, sans-serif',
|
17 |
'font_size' => '14',
|
18 |
'font_weight' => 'normal',
|
|
|
19 |
'title_font_family' => 'Helvetica, Arial, sans-serif',
|
20 |
'title_font_size' => '20',
|
21 |
'title_font_weight' => 'normal',
|
|
|
22 |
'block_background' => '#ffffff',
|
23 |
'layout' => 'full',
|
24 |
'button_label' => 'Click Here',
|
@@ -34,10 +36,12 @@ $url = $options['url'];
|
|
34 |
$font_family = $options['font_family'];
|
35 |
$font_size = $options['font_size'];
|
36 |
$font_weight = $options['font_weight'];
|
|
|
37 |
|
38 |
$title_font_family = $options['title_font_family'];
|
39 |
$title_font_size = $options['title_font_size'];
|
40 |
$title_font_weight = $options['title_font_weight'];
|
|
|
41 |
|
42 |
$button_color = $options['button_color'];
|
43 |
$button_background = $options['button_background'];
|
@@ -65,7 +69,7 @@ if (!empty($options['image'])) {
|
|
65 |
<style>
|
66 |
.hero-title {
|
67 |
font-size: <?php echo $title_font_size ?>px;
|
68 |
-
color:
|
69 |
padding-top: 30px;
|
70 |
font-family: <?php echo $title_font_family ?>;
|
71 |
font-weight: <?php echo $title_font_weight ?>;
|
@@ -74,7 +78,7 @@ if (!empty($options['image'])) {
|
|
74 |
padding: 20px 0 0 0;
|
75 |
font-size: <?php echo $font_size ?>px;
|
76 |
line-height: 150%;
|
77 |
-
color:
|
78 |
font-family: <?php echo $font_family ?>;
|
79 |
}
|
80 |
.hero-button-table {
|
16 |
'font_family' => 'Helvetica, Arial, sans-serif',
|
17 |
'font_size' => '14',
|
18 |
'font_weight' => 'normal',
|
19 |
+
'font_color' => '#000000',
|
20 |
'title_font_family' => 'Helvetica, Arial, sans-serif',
|
21 |
'title_font_size' => '20',
|
22 |
'title_font_weight' => 'normal',
|
23 |
+
'title_font_color' => '#000000',
|
24 |
'block_background' => '#ffffff',
|
25 |
'layout' => 'full',
|
26 |
'button_label' => 'Click Here',
|
36 |
$font_family = $options['font_family'];
|
37 |
$font_size = $options['font_size'];
|
38 |
$font_weight = $options['font_weight'];
|
39 |
+
$font_color = $options['font_color'];
|
40 |
|
41 |
$title_font_family = $options['title_font_family'];
|
42 |
$title_font_size = $options['title_font_size'];
|
43 |
$title_font_weight = $options['title_font_weight'];
|
44 |
+
$title_font_color = $options['title_font_color'];
|
45 |
|
46 |
$button_color = $options['button_color'];
|
47 |
$button_background = $options['button_background'];
|
69 |
<style>
|
70 |
.hero-title {
|
71 |
font-size: <?php echo $title_font_size ?>px;
|
72 |
+
color: <?php echo $title_font_color ?>;
|
73 |
padding-top: 30px;
|
74 |
font-family: <?php echo $title_font_family ?>;
|
75 |
font-weight: <?php echo $title_font_weight ?>;
|
78 |
padding: 20px 0 0 0;
|
79 |
font-size: <?php echo $font_size ?>px;
|
80 |
line-height: 150%;
|
81 |
+
color: <?php echo $font_color ?>;
|
82 |
font-family: <?php echo $font_family ?>;
|
83 |
}
|
84 |
.hero-button-table {
|
emails/blocks/hero/options.php
CHANGED
@@ -34,9 +34,9 @@
|
|
34 |
<td>
|
35 |
|
36 |
|
37 |
-
<?php $controls->text('button_label',
|
38 |
-
|
39 |
-
<?php $controls->text('url',
|
40 |
|
41 |
<table class="tnp-button-colors">
|
42 |
<tr>
|
34 |
<td>
|
35 |
|
36 |
|
37 |
+
<?php $controls->text('button_label', 12, 'Button label...') ?>
|
38 |
+
|
39 |
+
<?php $controls->text('url', 40, 'https://...') ?>
|
40 |
|
41 |
<table class="tnp-button-colors">
|
42 |
<tr>
|
emails/blocks/preheader/block.php
CHANGED
@@ -15,7 +15,8 @@ $default_options = array(
|
|
15 |
'block_background' => '#ffffff',
|
16 |
'font_family' => $font_family,
|
17 |
'font_size' => 13,
|
18 |
-
'
|
|
|
19 |
);
|
20 |
|
21 |
$options = array_merge($default_options, $options);
|
@@ -31,7 +32,15 @@ $options = array_merge($default_options, $options);
|
|
31 |
text-align: center;
|
32 |
font-size: <?php echo $options['font_size'] ?>px;
|
33 |
font-family: <?php echo $options['font_family'] ?>;
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
</style>
|
37 |
|
@@ -41,7 +50,7 @@ $options = array_merge($default_options, $options);
|
|
41 |
<?php echo $options['text'] ?>
|
42 |
</td>
|
43 |
<td class="preheader-link" width="50%" valign="top" align="center">
|
44 |
-
<a href="{email_url}" target="_blank" rel="noopener"
|
45 |
</td>
|
46 |
</tr>
|
47 |
</table>
|
15 |
'block_background' => '#ffffff',
|
16 |
'font_family' => $font_family,
|
17 |
'font_size' => 13,
|
18 |
+
'font_color' => '#999999',
|
19 |
+
'font_weight' => 'normal'
|
20 |
);
|
21 |
|
22 |
$options = array_merge($default_options, $options);
|
32 |
text-align: center;
|
33 |
font-size: <?php echo $options['font_size'] ?>px;
|
34 |
font-family: <?php echo $options['font_family'] ?>;
|
35 |
+
font-weight: <?php echo $options['font_weight'] ?>;
|
36 |
+
color: <?php echo $options['font_color'] ?>;
|
37 |
+
}
|
38 |
+
.preheader-view-link {
|
39 |
+
font-size: <?php echo $options['font_size'] ?>px;
|
40 |
+
font-family: <?php echo $options['font_family'] ?>;
|
41 |
+
font-weight: <?php echo $options['font_weight'] ?>;
|
42 |
+
color: <?php echo $options['font_color'] ?>;
|
43 |
+
text-decoration: none;
|
44 |
}
|
45 |
</style>
|
46 |
|
50 |
<?php echo $options['text'] ?>
|
51 |
</td>
|
52 |
<td class="preheader-link" width="50%" valign="top" align="center">
|
53 |
+
<a href="{email_url}" target="_blank" rel="noopener" class="preheader-view-link"><?php echo $options['view'] ?></a>
|
54 |
</td>
|
55 |
</tr>
|
56 |
</table>
|
emails/blocks/preheader/options.php
CHANGED
@@ -17,6 +17,12 @@
|
|
17 |
<td>
|
18 |
<?php $controls->text('view', 70) ?>
|
19 |
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
</tr>
|
21 |
<tr>
|
22 |
<th><?php _e('Background', 'newsletter')?></th>
|
17 |
<td>
|
18 |
<?php $controls->text('view', 70) ?>
|
19 |
</td>
|
20 |
+
</tr>
|
21 |
+
<tr>
|
22 |
+
<th>Font</th>
|
23 |
+
<td>
|
24 |
+
<?php $controls->css_font('font') ?>
|
25 |
+
</td>
|
26 |
</tr>
|
27 |
<tr>
|
28 |
<th><?php _e('Background', 'newsletter')?></th>
|
emails/tnp-composer/_css/newsletter-builder.css
CHANGED
@@ -274,19 +274,21 @@ iframe#tnp-mobile-preview {
|
|
274 |
top: 0;
|
275 |
left: -20px;
|
276 |
}
|
|
|
|
|
277 |
.tnpc-edit-box {
|
278 |
-
width:
|
279 |
-
background-color: rgba(255,255,255,1);
|
280 |
margin-right: auto;
|
281 |
margin-left: auto;
|
282 |
margin-top: 10px;
|
283 |
-webkit-box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.5);
|
284 |
-moz-box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.5);
|
285 |
box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.5);
|
286 |
-
padding:
|
287 |
display: none;
|
288 |
-
background-color: #
|
289 |
-
|
|
|
290 |
}
|
291 |
.tnpc-edit-box-title {
|
292 |
/*float: left;*/
|
@@ -399,11 +401,14 @@ iframe#tnp-mobile-preview {
|
|
399 |
border-radius: 50%;
|
400 |
color: rgba(0,0,0,1);
|
401 |
}
|
|
|
|
|
402 |
.tnpc-edit-box-buttons{
|
403 |
-
|
404 |
-
|
405 |
-
margin-
|
406 |
}
|
|
|
407 |
.tnpc-edit-box-buttons-save{
|
408 |
height: 35px;
|
409 |
text-align: right;
|
@@ -432,8 +437,8 @@ iframe#tnp-mobile-preview {
|
|
432 |
height: 35px;
|
433 |
text-align: right;
|
434 |
line-height: 35px;
|
435 |
-
color: #
|
436 |
-
font-weight:
|
437 |
font-size: 15px;
|
438 |
-webkit-border-radius: 3px;
|
439 |
-moz-border-radius: 3px;
|
@@ -448,7 +453,7 @@ iframe#tnp-mobile-preview {
|
|
448 |
padding-left: 25px;
|
449 |
width: 33%;*/
|
450 |
display: inline-block;
|
451 |
-
margin-
|
452 |
}
|
453 |
.tnpc-edit-box-buttons-cancel:hover {
|
454 |
color: #E74C3C;
|
274 |
top: 0;
|
275 |
left: -20px;
|
276 |
}
|
277 |
+
|
278 |
+
/* Block options container */
|
279 |
.tnpc-edit-box {
|
280 |
+
width: 850px;
|
|
|
281 |
margin-right: auto;
|
282 |
margin-left: auto;
|
283 |
margin-top: 10px;
|
284 |
-webkit-box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.5);
|
285 |
-moz-box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.5);
|
286 |
box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.5);
|
287 |
+
padding: 10px;
|
288 |
display: none;
|
289 |
+
background-color: #fff;
|
290 |
+
/*background-color: #EDF1F4;*/
|
291 |
+
/*border-radius: 10px;*/
|
292 |
}
|
293 |
.tnpc-edit-box-title {
|
294 |
/*float: left;*/
|
401 |
border-radius: 50%;
|
402 |
color: rgba(0,0,0,1);
|
403 |
}
|
404 |
+
|
405 |
+
/* Save and cancel buttons container on block options popup */
|
406 |
.tnpc-edit-box-buttons{
|
407 |
+
margin-top: 10px;
|
408 |
+
text-align: right;
|
409 |
+
margin-right: 10px;
|
410 |
}
|
411 |
+
|
412 |
.tnpc-edit-box-buttons-save{
|
413 |
height: 35px;
|
414 |
text-align: right;
|
437 |
height: 35px;
|
438 |
text-align: right;
|
439 |
line-height: 35px;
|
440 |
+
color: #666;
|
441 |
+
font-weight: normal;
|
442 |
font-size: 15px;
|
443 |
-webkit-border-radius: 3px;
|
444 |
-moz-border-radius: 3px;
|
453 |
padding-left: 25px;
|
454 |
width: 33%;*/
|
455 |
display: inline-block;
|
456 |
+
margin-right: 25px;
|
457 |
}
|
458 |
.tnpc-edit-box-buttons-cancel:hover {
|
459 |
color: #E74C3C;
|
emails/tnp-composer/edit.php
CHANGED
@@ -1,5 +1,14 @@
|
|
1 |
<?php
|
2 |
if (!defined('ABSPATH')) exit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
?>
|
4 |
<div class="tnpc-edit" id="tnpc-edit-image">
|
5 |
<div class="tnpc-edit-box">
|
@@ -17,10 +26,7 @@ if (!defined('ABSPATH')) exit;
|
|
17 |
<div class="tnpc-edit-box-content-text"><?php _e("LINK", "newsletter") ?> <span>(optional link address including http://)</span></div>
|
18 |
<div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
|
19 |
</div>
|
20 |
-
|
21 |
-
<div class="tnpc-edit-box-buttons-save"><?php _e("Save", "newsletter") ?></div>
|
22 |
-
<div class="tnpc-edit-box-buttons-cancel"><?php _e("Cancel", "newsletter") ?></div>
|
23 |
-
</div>
|
24 |
</div>
|
25 |
</div>
|
26 |
<script type="text/javascript">
|
@@ -258,12 +264,10 @@ if (!defined('ABSPATH')) exit;
|
|
258 |
</div>
|
259 |
</div>
|
260 |
|
|
|
261 |
<div class="tnpc-edit" id="tnpc-block-options">
|
262 |
<div class="tnpc-edit-box">
|
263 |
<form id="tnpc-block-options-form" onsubmit="return false;"></form>
|
264 |
-
|
265 |
-
<div class="tnpc-edit-box-buttons-save"><?php _e("Save", "newsletter") ?></div>
|
266 |
-
<div class="tnpc-edit-box-buttons-cancel"><?php _e("Cancel", "newsletter") ?></div>
|
267 |
-
</div>
|
268 |
</div>
|
269 |
</div>
|
1 |
<?php
|
2 |
if (!defined('ABSPATH')) exit;
|
3 |
+
|
4 |
+
function tnp_buttons_row() {
|
5 |
+
?>
|
6 |
+
<div class="tnpc-edit-box-buttons">
|
7 |
+
<div class="tnpc-edit-box-buttons-cancel"><?php _e("Cancel", "newsletter") ?></div>
|
8 |
+
<div class="tnpc-edit-box-buttons-save"><?php _e("Save", "newsletter") ?></div>
|
9 |
+
</div>
|
10 |
+
<?php
|
11 |
+
}
|
12 |
?>
|
13 |
<div class="tnpc-edit" id="tnpc-edit-image">
|
14 |
<div class="tnpc-edit-box">
|
26 |
<div class="tnpc-edit-box-content-text"><?php _e("LINK", "newsletter") ?> <span>(optional link address including http://)</span></div>
|
27 |
<div class="tnpc-edit-box-content-field"><input type="text" class="tnpc-edit-box-content-field-input url"/></div>
|
28 |
</div>
|
29 |
+
<?php tnp_buttons_row() ?>
|
|
|
|
|
|
|
30 |
</div>
|
31 |
</div>
|
32 |
<script type="text/javascript">
|
264 |
</div>
|
265 |
</div>
|
266 |
|
267 |
+
<?php // General container for generic block options ?>
|
268 |
<div class="tnpc-edit" id="tnpc-block-options">
|
269 |
<div class="tnpc-edit-box">
|
270 |
<form id="tnpc-block-options-form" onsubmit="return false;"></form>
|
271 |
+
<?php tnp_buttons_row() ?>
|
|
|
|
|
|
|
272 |
</div>
|
273 |
</div>
|
includes/controls.php
CHANGED
@@ -755,12 +755,10 @@ class NewsletterControls {
|
|
755 |
echo esc_attr($value);
|
756 |
echo '"/>';
|
757 |
}
|
758 |
-
|
759 |
function hidden($name) {
|
760 |
$value = $this->get_value($name);
|
761 |
-
echo '<input name="options['
|
762 |
-
echo esc_attr($value);
|
763 |
-
echo '"/>';
|
764 |
}
|
765 |
|
766 |
function button($action, $label, $function = null) {
|
@@ -1027,19 +1025,18 @@ class NewsletterControls {
|
|
1027 |
*/
|
1028 |
function preferences($name = 'preferences') {
|
1029 |
$lists = Newsletter::instance()->get_lists();
|
1030 |
-
|
1031 |
echo '<div class="newsletter-preferences-group">';
|
1032 |
|
1033 |
foreach ($lists as $list) {
|
1034 |
-
|
1035 |
echo '<div class="newsletter-preferences-item">';
|
1036 |
$this->checkbox2($name . '_' . $list->id, esc_html($list->name));
|
1037 |
echo '</div>';
|
1038 |
}
|
1039 |
}
|
1040 |
-
|
1041 |
-
function lists_checkboxes($name = 'lists')
|
1042 |
-
{
|
1043 |
$this->preferences_group($name);
|
1044 |
}
|
1045 |
|
@@ -1049,12 +1046,12 @@ class NewsletterControls {
|
|
1049 |
* will be an array if at east one preference is checked).
|
1050 |
*/
|
1051 |
function preferences_group($name = 'preferences') {
|
1052 |
-
|
1053 |
$lists = Newsletter::instance()->get_lists();
|
1054 |
|
1055 |
echo '<div class="newsletter-preferences-group">';
|
1056 |
foreach ($lists as $list) {
|
1057 |
-
|
1058 |
echo '<div class="newsletter-preferences-item">';
|
1059 |
$this->checkbox_group($name, $list->id, '(' . $list->id . ') ' . esc_html($list->name));
|
1060 |
echo '</div>';
|
@@ -1336,9 +1333,16 @@ class NewsletterControls {
|
|
1336 |
}
|
1337 |
|
1338 |
function css_font($name = 'font', $attrs = array()) {
|
|
|
|
|
1339 |
$this->css_font_family($name . '_family');
|
1340 |
$this->css_font_size($name . '_size');
|
1341 |
-
|
|
|
|
|
|
|
|
|
|
|
1342 |
}
|
1343 |
|
1344 |
function css_font_size($name = 'font_size') {
|
@@ -1354,7 +1358,7 @@ class NewsletterControls {
|
|
1354 |
}
|
1355 |
echo '</select>';
|
1356 |
}
|
1357 |
-
|
1358 |
function css_font_weight($name = 'font_weight') {
|
1359 |
$value = $this->get_value($name);
|
1360 |
|
@@ -1474,7 +1478,7 @@ class NewsletterControls {
|
|
1474 |
|
1475 |
$languages = Newsletter::instance()->get_languages();
|
1476 |
$languages = array_merge(array('' => 'All'), $languages);
|
1477 |
-
|
1478 |
$this->select($name, $languages);
|
1479 |
}
|
1480 |
|
@@ -1592,14 +1596,15 @@ class NewsletterControls {
|
|
1592 |
}
|
1593 |
|
1594 |
function block_padding($name = 'block_padding') {
|
|
|
1595 |
$this->text($name . '_top', 5);
|
1596 |
-
echo '
|
|
|
|
|
1597 |
$this->text($name . '_right', 5);
|
1598 |
-
echo '
|
1599 |
$this->text($name . '_bottom', 5);
|
1600 |
-
echo '
|
1601 |
-
$this->text($name . '_left', 5);
|
1602 |
-
echo 'px (left)<br>';
|
1603 |
}
|
1604 |
|
1605 |
}
|
755 |
echo esc_attr($value);
|
756 |
echo '"/>';
|
757 |
}
|
758 |
+
|
759 |
function hidden($name) {
|
760 |
$value = $this->get_value($name);
|
761 |
+
echo '<input name="options[', esc_attr($name), ']" id="options-', esc_attr($name), '" type="hidden" value="', esc_attr($value), '">';
|
|
|
|
|
762 |
}
|
763 |
|
764 |
function button($action, $label, $function = null) {
|
1025 |
*/
|
1026 |
function preferences($name = 'preferences') {
|
1027 |
$lists = Newsletter::instance()->get_lists();
|
1028 |
+
|
1029 |
echo '<div class="newsletter-preferences-group">';
|
1030 |
|
1031 |
foreach ($lists as $list) {
|
1032 |
+
|
1033 |
echo '<div class="newsletter-preferences-item">';
|
1034 |
$this->checkbox2($name . '_' . $list->id, esc_html($list->name));
|
1035 |
echo '</div>';
|
1036 |
}
|
1037 |
}
|
1038 |
+
|
1039 |
+
function lists_checkboxes($name = 'lists') {
|
|
|
1040 |
$this->preferences_group($name);
|
1041 |
}
|
1042 |
|
1046 |
* will be an array if at east one preference is checked).
|
1047 |
*/
|
1048 |
function preferences_group($name = 'preferences') {
|
1049 |
+
|
1050 |
$lists = Newsletter::instance()->get_lists();
|
1051 |
|
1052 |
echo '<div class="newsletter-preferences-group">';
|
1053 |
foreach ($lists as $list) {
|
1054 |
+
|
1055 |
echo '<div class="newsletter-preferences-item">';
|
1056 |
$this->checkbox_group($name, $list->id, '(' . $list->id . ') ' . esc_html($list->name));
|
1057 |
echo '</div>';
|
1333 |
}
|
1334 |
|
1335 |
function css_font($name = 'font', $attrs = array()) {
|
1336 |
+
$default = array('color' => true, 'weight'=>true);
|
1337 |
+
$attrs = array_merge($default, $attrs);
|
1338 |
$this->css_font_family($name . '_family');
|
1339 |
$this->css_font_size($name . '_size');
|
1340 |
+
if ($attrs['weight']) {
|
1341 |
+
$this->css_font_weight($name . '_weight');
|
1342 |
+
}
|
1343 |
+
if ($attrs['color']) {
|
1344 |
+
$this->color($name . '_color');
|
1345 |
+
}
|
1346 |
}
|
1347 |
|
1348 |
function css_font_size($name = 'font_size') {
|
1358 |
}
|
1359 |
echo '</select>';
|
1360 |
}
|
1361 |
+
|
1362 |
function css_font_weight($name = 'font_weight') {
|
1363 |
$value = $this->get_value($name);
|
1364 |
|
1478 |
|
1479 |
$languages = Newsletter::instance()->get_languages();
|
1480 |
$languages = array_merge(array('' => 'All'), $languages);
|
1481 |
+
|
1482 |
$this->select($name, $languages);
|
1483 |
}
|
1484 |
|
1596 |
}
|
1597 |
|
1598 |
function block_padding($name = 'block_padding') {
|
1599 |
+
echo '<div style="text-align: center; width: 250px;">';
|
1600 |
$this->text($name . '_top', 5);
|
1601 |
+
echo '<br>';
|
1602 |
+
$this->text($name . '_left', 5);
|
1603 |
+
echo " ";
|
1604 |
$this->text($name . '_right', 5);
|
1605 |
+
echo '<br>';
|
1606 |
$this->text($name . '_bottom', 5);
|
1607 |
+
echo '</div>';
|
|
|
|
|
1608 |
}
|
1609 |
|
1610 |
}
|
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: 5.8.
|
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', '5.8.
|
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: 5.8.7
|
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', '5.8.7');
|
33 |
|
34 |
global $newsletter, $wpdb;
|
35 |
|
profile/profile.php
CHANGED
@@ -297,16 +297,18 @@ class NewsletterProfile extends NewsletterModule {
|
|
297 |
$buffer .= $x['field'];
|
298 |
$buffer .= "</div>\n";
|
299 |
}
|
|
|
|
|
300 |
|
301 |
// Privacy
|
302 |
$privacy_url = NewsletterSubscription::instance()->get_privacy_url();
|
303 |
-
if (!empty($
|
304 |
$buffer .= '<div class="tnp-field tnp-field-privacy">';
|
305 |
if ($privacy_url) {
|
306 |
$buffer .= '<a href="' . $privacy_url . '" target="_blank">';
|
307 |
}
|
308 |
|
309 |
-
$buffer .= $
|
310 |
|
311 |
if ($privacy_url) {
|
312 |
$buffer .= '</a>';
|
@@ -315,7 +317,7 @@ class NewsletterProfile extends NewsletterModule {
|
|
315 |
}
|
316 |
|
317 |
$buffer .= '<div class="tnp-field tnp-field-button">';
|
318 |
-
$buffer .= '<input class="tnp-submit" type="submit" value="' . esc_attr($
|
319 |
$buffer .= "</div>\n";
|
320 |
|
321 |
$buffer .= "</form>\n</div>\n";
|
297 |
$buffer .= $x['field'];
|
298 |
$buffer .= "</div>\n";
|
299 |
}
|
300 |
+
|
301 |
+
$local_options = $this->get_options($sub, $this->get_user_language($user));
|
302 |
|
303 |
// Privacy
|
304 |
$privacy_url = NewsletterSubscription::instance()->get_privacy_url();
|
305 |
+
if (!empty($local_options['privacy_label']) && !empty($privacy_url)) {
|
306 |
$buffer .= '<div class="tnp-field tnp-field-privacy">';
|
307 |
if ($privacy_url) {
|
308 |
$buffer .= '<a href="' . $privacy_url . '" target="_blank">';
|
309 |
}
|
310 |
|
311 |
+
$buffer .= $local_options['privacy_label'];
|
312 |
|
313 |
if ($privacy_url) {
|
314 |
$buffer .= '</a>';
|
317 |
}
|
318 |
|
319 |
$buffer .= '<div class="tnp-field tnp-field-button">';
|
320 |
+
$buffer .= '<input class="tnp-submit" type="submit" value="' . esc_attr($local_options['save_label']) . '">';
|
321 |
$buffer .= "</div>\n";
|
322 |
|
323 |
$buffer .= "</form>\n</div>\n";
|
readme.txt
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
=== Newsletter ===
|
2 |
Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated,mailing list
|
3 |
Requires at least: 3.4.0
|
4 |
-
Tested up to: 5.0.
|
5 |
-
Stable tag: 5.8.
|
6 |
Contributors: satollo,webagile,michael-travan
|
7 |
|
8 |
Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
|
@@ -122,6 +122,15 @@ Thank you, The Newsletter Team
|
|
122 |
|
123 |
== Changelog ==
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
= 5.8.6 =
|
126 |
|
127 |
* Improved geolocation support
|
1 |
=== Newsletter ===
|
2 |
Tags: newsletter,email,subscription,mass mail,list build,email marketing,direct mailing,automation,automated,mailing list
|
3 |
Requires at least: 3.4.0
|
4 |
+
Tested up to: 5.0.3
|
5 |
+
Stable tag: 5.8.7
|
6 |
Contributors: satollo,webagile,michael-travan
|
7 |
|
8 |
Add a real newsletter system to your blog. For free. With unlimited newsletters and subscribers.
|
122 |
|
123 |
== Changelog ==
|
124 |
|
125 |
+
= 5.8.6 =
|
126 |
+
|
127 |
+
* Tags replacement even on template for messages
|
128 |
+
* Fixed profile page labels translation
|
129 |
+
* Added text and title color on hero block
|
130 |
+
* Added text color on preheader block
|
131 |
+
* Fixed giphy options panel
|
132 |
+
|
133 |
+
|
134 |
= 5.8.6 =
|
135 |
|
136 |
* Improved geolocation support
|
subscription/options.php
CHANGED
@@ -72,7 +72,7 @@ if ($controls->is_action()) {
|
|
72 |
$addresses = array();
|
73 |
foreach ($users as &$user) {
|
74 |
$addresses[] = $user->email;
|
75 |
-
$res = $module->
|
76 |
if (!$res) {
|
77 |
$controls->errors = 'The email address ' . $user->email . ' failed.';
|
78 |
break;
|
@@ -93,7 +93,7 @@ if ($controls->is_action()) {
|
|
93 |
$addresses = array();
|
94 |
foreach ($users as $user) {
|
95 |
$addresses[] = $user->email;
|
96 |
-
$res = $module->
|
97 |
if (!$res) {
|
98 |
$controls->errors = 'The email address ' . $user->email . ' failed.';
|
99 |
break;
|
72 |
$addresses = array();
|
73 |
foreach ($users as &$user) {
|
74 |
$addresses[] = $user->email;
|
75 |
+
$res = $module->send_message('confirmation', $user);
|
76 |
if (!$res) {
|
77 |
$controls->errors = 'The email address ' . $user->email . ' failed.';
|
78 |
break;
|
93 |
$addresses = array();
|
94 |
foreach ($users as $user) {
|
95 |
$addresses[] = $user->email;
|
96 |
+
$res = $module->send_message('confirmed', $user);
|
97 |
if (!$res) {
|
98 |
$controls->errors = 'The email address ' . $user->email . ' failed.';
|
99 |
break;
|
subscription/subscription.php
CHANGED
@@ -816,11 +816,16 @@ class NewsletterSubscription extends NewsletterModule {
|
|
816 |
}
|
817 |
|
818 |
/**
|
819 |
-
*
|
820 |
-
*
|
|
|
|
|
|
|
821 |
* @return type
|
822 |
*/
|
823 |
-
function mail($
|
|
|
|
|
824 |
$options_template = $this->get_options('template', $language);
|
825 |
|
826 |
$template = trim($options_template['template']);
|
@@ -832,8 +837,10 @@ class NewsletterSubscription extends NewsletterModule {
|
|
832 |
$headers = array('Auto-Submitted' => 'auto-generated');
|
833 |
|
834 |
// Replaces tags from the template
|
835 |
-
$message = $this->replace($message);
|
836 |
-
|
|
|
|
|
837 |
}
|
838 |
|
839 |
/**
|
@@ -902,15 +909,17 @@ class NewsletterSubscription extends NewsletterModule {
|
|
902 |
if (!$force && !empty($this->options[$type . '_disabled'])) {
|
903 |
return true;
|
904 |
}
|
|
|
|
|
905 |
|
906 |
-
$options = $this->get_options('', $
|
907 |
$message = $options[$type . '_message'];
|
908 |
if ($user->status == Newsletter::STATUS_NOT_CONFIRMED) {
|
909 |
$message = $this->add_microdata($message);
|
910 |
}
|
911 |
$subject = $options[$type . '_subject'];
|
912 |
-
|
913 |
-
return $this->mail($user
|
914 |
}
|
915 |
|
916 |
/**
|
816 |
}
|
817 |
|
818 |
/**
|
819 |
+
* Sends a service message applying the template.
|
820 |
+
*
|
821 |
+
* @param TNP_User $user
|
822 |
+
* @param string $subject
|
823 |
+
* @param string $message
|
824 |
* @return type
|
825 |
*/
|
826 |
+
function mail($user, $subject, $message) {
|
827 |
+
$language = $this->get_user_language($user);
|
828 |
+
|
829 |
$options_template = $this->get_options('template', $language);
|
830 |
|
831 |
$template = trim($options_template['template']);
|
837 |
$headers = array('Auto-Submitted' => 'auto-generated');
|
838 |
|
839 |
// Replaces tags from the template
|
840 |
+
$message = $this->replace($message, $user);
|
841 |
+
$subject = $this->replace($subject, $user);
|
842 |
+
|
843 |
+
return Newsletter::instance()->mail($user->email, $subject, $message, $headers);
|
844 |
}
|
845 |
|
846 |
/**
|
909 |
if (!$force && !empty($this->options[$type . '_disabled'])) {
|
910 |
return true;
|
911 |
}
|
912 |
+
|
913 |
+
$language = $this->get_user_language($user);
|
914 |
|
915 |
+
$options = $this->get_options('', $language);
|
916 |
$message = $options[$type . '_message'];
|
917 |
if ($user->status == Newsletter::STATUS_NOT_CONFIRMED) {
|
918 |
$message = $this->add_microdata($message);
|
919 |
}
|
920 |
$subject = $options[$type . '_subject'];
|
921 |
+
|
922 |
+
return $this->mail($user, $subject, $message);
|
923 |
}
|
924 |
|
925 |
/**
|
unsubscription/unsubscription.php
CHANGED
@@ -115,7 +115,7 @@ class NewsletterUnsubscription extends NewsletterModule {
|
|
115 |
$message = $options['unsubscribed_message'];
|
116 |
$subject = $options['unsubscribed_subject'];
|
117 |
|
118 |
-
return NewsletterSubscription::instance()->mail($user
|
119 |
}
|
120 |
|
121 |
/**
|
115 |
$message = $options['unsubscribed_message'];
|
116 |
$subject = $options['unsubscribed_subject'];
|
117 |
|
118 |
+
return NewsletterSubscription::instance()->mail($user, $subject, $message);
|
119 |
}
|
120 |
|
121 |
/**
|