first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,46 @@
jQuery.cookie = function(name, value, options) {
if (typeof value != 'undefined') { // name and value given, set cookie
options = options || {};
if (value === null) {
value = '';
options.expires = -1;
}
var expires = '';
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
var date;
if (typeof options.expires == 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
}
// CAUTION: Needed to parenthesize options.path and options.domain
// in the following expressions, otherwise they evaluate to undefined
// in the packed version for some reason...
var path = options.path ? '; path=' + (options.path) : '';
var domain = options.domain ? '; domain=' + (options.domain) : '';
var secure = options.secure ? '; secure' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
} else { // only name given, get cookie
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
};
function tnp_toggle_schedule() {
jQuery("#tnp-schedule-button").toggle();
jQuery("#tnp-schedule").toggle();
}

View File

@@ -0,0 +1,151 @@
.tnp-drowpdown ul, .tnp-drowpdown li {
margin: 0; padding: 0; border: 0;
}
/* Removed by Stefano */
.tnp-drowpdown li {
/*min-width: 150px;*/
}
.tnp-drowpdown {
margin-top: 10px;
-webkit-transition-timing-function: ease;
padding: 5px;
font-size: 12px;
margin-bottom: 10px;
color: #fff;
}
.tnp-drowpdown a {
text-decoration: none;
color: white;
letter-spacing: 0.1em;
}
.tnp-drowpdown a:hover {
color: #fff;
}
.tnp-drowpdown {
-webkit-transition: width 2s;
transition: width 2s;
}
.tnp-drowpdown ul ul {
display: none;
z-index: 10000;
}
.tnp-drowpdown ul li:hover > ul {
display: block;
}
.tnp-drowpdown ul {
padding: 0 20px;
list-style: none;
position: relative;
display: inline-table;
}
.tnp-drowpdown ul:after {
content: "";
clear: both;
display: block;
}
.tnp-drowpdown ul li {
float: left;
margin-left: 10px;
text-transform: uppercase;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.tnp-drowpdown ul li:hover {
background-color: #34495E;
/*border: 1px solid #34495E;*/
}
.tnp-drowpdown ul li:hover a {
}
.tnp-drowpdown ul li a {
display: block;
padding: 10px 10px;
text-decoration: none;
}
.tnp-drowpdown ul li a small {
display: block;
color: #afafaf;
}
.tnp-drowpdown ul ul {
background: #332D39;
border-radius: 0px;
padding: 0;
position: absolute;
}
.tnp-drowpdown ul ul li {
float: none;
position: relative;
margin-left: 0;
border: none;
text-transform: none;
line-height: 1.6em;
}
.tnp-drowpdown ul ul li:nth-child(even) {
background-color: #3b3342;
}
.tnp-drowpdown ul ul li:hover {
background: inherit;
}
.tnp-drowpdown ul ul li a {
padding: 5px 15px;
color: #fff;
}
.tnp-drowpdown ul ul li a:hover {
background: #34495E;
}
.tnp-drowpdown ul ul ul {
position: absolute; left: 100%; top:0;
}
.tnp-wrap ul li {
list-style-type: none;
}
.tnp-professional-extensions-button {
background-color: #27AE60;
border: 1px solid #27AE60 !important;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
border-radius: 3px;
}
.tnp-professional-extensions-button:hover {
background-color: #2ECC71 !important;
border: 1px solid #2ECC71 !important;
}
.tnp-professional-extensions-button-red {
background-color: #C0392B;
border: 1px solid #C0392B !important;
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
border-radius: 3px;
}
.tnp-professional-extensions-button-red:hover {
background-color: #E74C3C !important;
border: 1px solid #E74C3C !important;
}

View File

@@ -0,0 +1,102 @@
/* DEBUG - Disable when done */
/*.tnp-field {*/
/*border: 1px dashed #999;*/
/*}*/
.tnp-section {
}
/* Labels */
.tnp-label {
/* margin: 5px; */
/* text-align: center; */
color: #868686;
/* margin-bottom: 20px; */
font-family: Circular Std, sans-serif;
font-weight: 300;
border-bottom: 1px solid #fff;
padding-bottom: 10px;
}
.tnp-field.tnp-separator {
border-top: 1px solid #ddd;
line-height: 0;
}
/* Single field/row container */
.tnp-field {
display: block;
width: 100%;
margin-bottom: 10px;
}
.tnp-field label.tnp-label {
display: block;
font-size: 12px;
color: #868686;
font-family: "Circular Std", sans-serif;
font-weight: 300;
border-bottom: 1px solid #fff;
margin: 30px 0px 10px 0px;
}
.tnp-field.tnp-checkbox label {
display: inline;
}
/* Set of inlined field for font, size, color... */
tnp-field.tnp-font {
}
.tnp-field input {
width: 100%;
}
.tnp-field.tnp-size input {
width: 60px;
display: inline;
}
.tnp-field .tnp-padding-fields {
display: inline;
}
/* Four field for block padding selection */
.tnp-field .tnp-padding-fields input {
width: 40px;
display: inline;
}
.tnp-field select {
width: auto!important;
color: #34495E;
}
.tnp-field input[type=url] {
font-family: monospace;
}
.tnp-field input[type=color] {
width: 40px;
height: 27px;
}
.tnp-field input[type=submit] {
width: auto;
}
.tnp-field input[type=checkbox] {
width: auto;
}
.tnp-field.tnp-categories {
}
/* The label for each category checkbox (should override the generic label appearance) */
.tnp-field.tnp-categories label {
}

View File

@@ -0,0 +1,16 @@
/* The CSS used for the WP editor on administration panels */
body {
font-size: 16px;
font-family: sans-serif;
margin: 20px;
}
.mce-content-body p, table, ul, ol {
margin-bottom: 15px;
width: 650px;
line-height: 24px;
}
img {
max-width: 100%;
}

View File

@@ -0,0 +1,44 @@
<?php
/*
* Name: Company Info
* Section: footer
* Description: Company Info for Can-Spam act requirements
*/
$default_options = array(
'block_background' => '#ffffff',
'font_family' => $font_family,
'font_size' => 13,
'font_color' => '#999999',
'font_weight' => 'normal',
'block_padding_top' => 15,
'block_padding_bottom' => 15,
'block_padding_left' => 15,
'block_padding_right' => 15
);
$options = array_merge($default_options, $options);
?>
<style>
.canspam-text {
padding: 10px;
text-align: center;
font-size: <?php echo $options['font_size'] ?>px;
font-family: <?php echo $options['font_family'] ?>;
font-weight: <?php echo $options['font_weight'] ?>;
color: <?php echo $options['font_color'] ?>;
}
</style>
<table width="100%" style="width: 100%!important" border="0" cellspacing="0" cellpadding="0" align="center" class="responsive-table">
<tr>
<td align="center" class="canspam-text">
<?php echo!empty($block_options['footer_title']) ? $block_options['footer_title'] : 'Your Company' ?>
<br>
<?php echo!empty($block_options['footer_contact']) ? $block_options['footer_contact'] : 'Company Address, Phone Number' ?>
<br>
<em><?php echo!empty($block_options['footer_legal']) ? $block_options['footer_legal'] : 'Copyright or Legal text' ?></em>
</div>
</td>
</tr>
</table>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -0,0 +1,9 @@
<?php
/* @var $fields NewsletterFields */
?>
<p>Company data can be globally set on company info panel.</p>
<?php $fields->font() ?>
<?php $fields->block_commons() ?>

View File

@@ -0,0 +1,54 @@
<?php
/*
* Name: Call To Action
* Section: content
* Description: Call to action button
*/
$default_options = array(
'text' => 'Call to action',
'background' => '#256F9C',
'font_color' => '#ffffff',
'url' => home_url(),
'font_family' => $font_family,
'font_size' => 16,
'font_weight' => 'normal',
'block_background' => '#ffffff',
'width' => '200',
'block_padding_top' => 20,
'block_padding_bottom' => 20,
);
$options = array_merge($default_options, $options);
?>
<style>
.cta-button {
font-size: <?php echo $options['font_size'] ?>px;
font-family: <?php echo $options['font_family'] ?>;
font-weight: <?php echo $options['font_weight'] ?>;
color: <?php echo $options['font_color'] ?>;
text-decoration: none;
background-color: <?php echo $options['background'] ?>;
line-height: normal;
border-top: 15px solid <?php echo $options['background'] ?>;
border-bottom: 15px solid <?php echo $options['background'] ?>;
border-left: 25px solid <?php echo $options['background'] ?>;
border-right: 25px solid <?php echo $options['background'] ?>;
width: <?php echo $options['width'] ?>px;
max-width: 100%;
box-sizing: border-box;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
display: inline-block;
}
</style>
<a href="<?php echo $options['url'] ?>" target="_blank" rel="noopener" class="cta-button"><?php echo $options['text'] ?></a>
<div itemscope="" itemtype="http://schema.org/EmailMessage">
<div itemprop="potentialAction" itemscope="" itemtype="http://schema.org/ViewAction">
<meta itemprop="url" content="<?php echo esc_attr($options['url']) ?>" />
<meta itemprop="name" content="<?php echo esc_attr($options['text']) ?>" />
</div>
<meta itemprop="description" content="<?php echo esc_attr($options['text']) ?>" />
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1,12 @@
<?php
/* @var $fields NewsletterFields */
?>
<?php $fields->text('text', 'Button label') ?>
<?php $fields->url('url', 'Button URL') ?>
<?php $fields->font('font', __('Font', 'newsletter')) ?>
<?php $fields->color('background', 'Button background') ?>
<?php $fields->size('width', __('Width', 'newsletter')) ?>
<?php $fields->block_commons() ?>

View File

@@ -0,0 +1,45 @@
<?php
/*
* Name: Footer
* Section: footer
* Description: View online ad profile links
*/
$default_options = array(
'view' => 'View online',
'profile' => 'Modify your subscription',
'block_background' => '#ffffff',
'font_family' => $font_family,
'font_size' => 13,
'font_color' => '#444444',
'font_weight' => 'normal',
'block_padding_left' => 15,
'block_padding_right' => 15,
'block_padding_bottom' => 15,
'block_padding_top' => 15
);
$options = array_merge($default_options, $options);
?>
<style>
.footer-text {
font-size: <?php echo $options['font_size'] ?>px;
font-family: <?php echo $options['font_family'] ?>;
font-weight: <?php echo $options['font_weight'] ?>;
color: <?php echo $options['font_color'] ?>;
text-decoration: none;
}
</style>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<a class="footer-text" href="{profile_url}"><?php echo $options['profile'] ?></a>
<span class="footer-text">&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;</span>
<a class="footer-text" href="{email_url}"><?php echo $options['view'] ?></a>
</td>
</tr>
</table>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,11 @@
<?php
/* @var $fields NewsletterFields */
?>
<?php $fields->text('view', 'View online label') ?>
<?php $fields->text('profile', 'Subscription details label') ?>
<?php $fields->font() ?>
<?php $fields->block_commons() ?>

View File

@@ -0,0 +1,36 @@
<?php
/*
* Name: Giphy
* Section: content
* Description: Add a Giphy image
*
*/
/* @var $options array */
/* @var $wpdb wpdb */
$default_options = array(
'view'=>'View online',
'text'=>'Few words summary',
'block_background'=>'#ffffff',
'font_family'=>$font_family,
'font_size'=>13,
'color'=>'#999999',
'block_padding_top'=>15,
'block_padding_bottom'=>15,
'block_padding_left'=>0,
'block_padding_right'=>0
);
$options = array_merge($default_options, $options);
?>
<table width="100%" border="0" cellpadding="0" align="center" cellspacing="0">
<tr>
<td width="100%" valign="top" align="center">
<img src="<?php echo $options['giphy_url'] ?>" style="max-width: 100%!important; height: auto!important;" />
</td>
</tr>
</table>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1,50 @@
<?php
/*
* @var $options array contains all the options the current block we're ediging contains
* @var $controls NewsletterControls
*/
?>
<?php $fields->text('q', __('Search')) ?>
<div style="clear: both; max-height: 300px; overflow: scroll; margin-bottom: 15px" id="tnp-giphy-results"></div>
<?php $controls->hidden('giphy_url') ?>
<div id="giphy-preview">
<?php if (!empty($controls->data['giphy_url'])) { ?>
<img src="<?php echo esc_attr($controls->data['giphy_url'])?>" style="max-width: 300px">
<?php } ?>
</div>
<?php $fields->block_commons() ?>
<script type="text/javascript">
function choose_gif(url) {
//jQuery("#tnp-giphy-results").html("");
jQuery("#options-giphy_url").val(url);
jQuery("#giphy-preview").html('<img src="' + url + '" style="max-width: 300px">');
jQuery("#options-giphy_url").trigger("change");
}
jQuery("#options-q").keyup(
function () {
if (typeof(tid) != "undefined") {
window.clearTimeout(tid);
}
tid = window.setTimeout(function () {
var rating = "r";
var limit = 20;
var offset = 0;
jQuery.get("https://api.giphy.com/v1/gifs/search", {limit: limit, rating: rating, api_key: "57FLbVJJd7oQBZ0fEiRnzhM2VtZp5OP1", q: jQuery("#options-q").val()}, function (data) {
jQuery("#tnp-giphy-results").html("");
jQuery.each(data.data, function (index, value) {
jQuery("#tnp-giphy-results").append('<div style="overflow: hidden; width: 120px; height: 120px; 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>');
});
}, "json");
}, 500);
});
jQuery("#options-q").trigger('keyup');
</script>

View File

@@ -0,0 +1,75 @@
<?php
/*
* Name: Header
* Section: header
* Description: Default header with company info
*/
$default_options = array(
'font_family' => $font_family,
'font_size' => 14,
'font_color' => '#444444',
'font_weight' => 'normal',
'block_background' => '#ffffff',
'block_padding_top'=>15,
'block_padding_bottom'=>15,
'block_padding_left'=>15,
'block_padding_right'=>15
);
$options = array_merge($default_options, $options);
if (empty($info['header_logo']['id'])) {
$image = false;
} else {
$image = tnp_media_resize($info['header_logo']['id'], array(200, 80));
if (is_wp_error($image)) {
$image = false;
}
}
$empty = empty($info['header_logo']['id']) && empty($info['header_sub']) && empty($info['header_title']);
?>
<?php if ($empty) { ?>
<p>Please, set your company info.</p>
<?php } else { ?>
<style>
.header-text {
padding: 10px;
text-align: right;
font-size: <?php echo $options['font_size'] ?>px;
font-family: <?php echo $options['font_family'] ?>;
font-weight: <?php echo $options['font_weight'] ?>;
color: <?php echo $options['font_color'] ?>;
}
.header-logo {
font-family: <?php echo $options['font_family'] ?>;
font-size: <?php echo $options['font_size']*1.1 ?>px;
line-height: normal;
font-weight: <?php echo $options['font_weight'] ?>;
color: <?php echo $options['font_color'] ?>;
}
</style>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<?php if ( $image ) { ?>
<td align="left" width="50%" inline-class="header-logo">
<a href="#" target="_blank">
<img alt="<?php echo esc_attr( $info['header_title'] ) ?>" src="<?php echo $image ?>"
style="display: block; max-width: 100%" border="0">
</a>
<?php } else { ?>
<td align="left" width="50%" inline-class="heading-text"
style="padding: 5px; font-size: 24px; font-family: Helvetica, Arial, sans-serif; font-weight: bold; color: #444444;">
<?php echo esc_attr( $info['header_title'] ) ?>
<?php } ?>
</td>
<td width="50%" align="right" class="mobile-hide" inline-class="header-text">
<?php echo $info['header_sub'] ?>
</td>
</tr>
</table>
<?php } ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,11 @@
<?php
/* @var $options array contains all the options the current block we're ediging contains */
/* @var $controls NewsletterControls */
/* @var $controls NewsletterFields */
?>
<p>This block uses the <a href="?page=newsletter_main_info" target="_blank">global company info</a>.</p>
<?php $fields->font()?>
<?php $fields->block_commons() ?>

View File

@@ -0,0 +1,11 @@
.header-logo {
text-align: center!important;
}
@media all and (max-width: 640) {
.header-table td {
width: 100%!important;
}
.header-logo {
text-align: center!important;
}
}

View File

@@ -0,0 +1,43 @@
<?php
/*
* Name: Heading
* Section: content
* Description: Section title
*/
$default_options = array(
'text' => 'An Awesome Title',
'align' => 'center',
'block_background' => '#ffffff',
'font_family' => $font_family,
'font_size' => 30,
'font_color' => '#444444',
'font_weight' => 'normal',
'block_padding_left' => 15,
'block_padding_right' => 15,
'block_padding_bottom' => 15,
'block_padding_top' => 15
);
$options = array_merge($default_options, $options);
?>
<style>
.heading-text {
padding: 10px;
text-align: <?php echo $options['align'] ?>;
font-size: <?php echo $options['font_size'] ?>px;
font-family: <?php echo $options['font_family'] ?>;
font-weight: <?php echo $options['font_weight'] ?>;
color: <?php echo $options['font_color'] ?>;
}
</style>
<table border="0" cellpadding="0" cellspacing="0" width="100%" >
<tr>
<td align="center" class="heading-text">
<?php echo $options['text'] ?>
</td>
</tr>
</table>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -0,0 +1,10 @@
<?php
/* @var $fields NewsletterFields */
?>
<?php $fields->text('text', __('Text', 'newsletter')) ?>
<?php $fields->font() ?>
<?php $fields->select('align', 'Alignment', array('center'=>'Center', 'left'=>'Left', 'right'=>'Right')) ?>
<?php $fields->block_commons() ?>

View File

@@ -0,0 +1,238 @@
<?php
/*
* Name: Last posts
* Section: content
* Description: Last opsts list with different layouts
*/
/* @var $options array */
/* @var $wpdb wpdb */
$defaults = array(
'button_url' => '',
'title' => 'An Awesome Title',
'text' => 'This is just a simple text you should change',
'font_family' => 'Helvetica, Arial, sans-serif',
'font_size' => '14',
'font_weight' => 'normal',
'font_color' => '#000000',
'title_font_family' => 'Helvetica, Arial, sans-serif',
'title_font_size' => '20',
'title_font_weight' => 'normal',
'title_font_color' => '#000000',
'block_background' => '#ffffff',
'layout' => 'full',
'button_label' => 'Click Here',
'button_color' => '#ffffff',
'button_background' => '#256F9C',
'layout' => 'full',
'block_padding_top'=>20,
'block_padding_bottom'=>20
);
$options = array_merge($defaults, $options);
$layout = $options['layout'];
if ($layout == 'full') {
$options = array_merge(array('block_padding_left'=>0, 'block_padding_right'=>0), $options);
} else {
$options = array_merge(array('block_padding_left'=>15, 'block_padding_right'=>15), $options);
}
$url = $options['button_url'];
$font_family = $options['font_family'];
$font_size = $options['font_size'];
$font_weight = $options['font_weight'];
$font_color = $options['font_color'];
$title_font_family = $options['title_font_family'];
$title_font_size = $options['title_font_size'];
$title_font_weight = $options['title_font_weight'];
$title_font_color = $options['title_font_color'];
$button_color = $options['button_color'];
$button_background = $options['button_background'];
$button_label = $options['button_label'];
$layout = $options['layout'];
if (!empty($options['image']['id'])) {
if ($layout == 'full') {
$image = tnp_media_resize($options['image']['id'], array(600, 0));
} else {
$image = tnp_media_resize($options['image']['id'], array(300, 200, true));
}
} else {
$image = false;
}
?>
<?php if ($layout == 'full') { ?>
<style>
.hero-title {
font-size: <?php echo $title_font_size ?>px;
color: <?php echo $title_font_color ?>;
padding-top: 30px;
font-family: <?php echo $title_font_family ?>;
font-weight: <?php echo $title_font_weight ?>;
}
.hero-text {
padding: 20px 0 0 0;
font-size: <?php echo $font_size ?>px;
line-height: 150%;
color: <?php echo $font_color ?>;
font-family: <?php echo $font_family ?>;
}
.hero-button-table {
background-color: <?php echo $button_background ?>;
/*border:1px solid #353535;*/
border-radius:5px;
}
.hero-button-td {
color: <?php echo $button_color ?>;
font-family:<?php echo $font_family ?>;
font-size:16px;
font-weight:normal;
letter-spacing:-.5px;
line-height:150%;
padding-top:15px;
padding-right:30px;
padding-bottom:15px;
padding-left:30px;
}
.hero-button-a {
color:<?php echo $button_color ?>;
text-decoration:none;
}
.hero-image {
max-width: 100%!important;
display: block;
border: 0px;
}
</style>
<!-- HERO IMAGE -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="padding-copy tnpc-row-edit">
<a href="<?php echo $url ?>" target="_blank" rel="noopener nofollow">
<img src="<?php echo $image ?>" border="0" alt="Image" inline-class="hero-image">
</a>
</td>
</tr>
<tr>
<td>
<!-- COPY -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" inline-class="hero-title">
<span><?php echo $options['title'] ?></span>
</td>
</tr>
<tr>
<td align="center" inline-class="hero-text">
<span><?php echo $options['text'] ?></span>
</td>
</tr>
<tr>
<td align="center">
<br>
<table border="0" cellpadding="0" cellspacing="0" inline-class="hero-button-table" align="center">
<tr>
<td align="center" valign="middle" inline-class="hero-button-td">
<a href="<?php echo esc_attr($url) ?>" target="_blank" inline-class="hero-button-a"><?php echo $button_label ?></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php } ?>
<?php if ($layout == 'left') { ?>
<style>
.hero-title {
font-size: <?php echo $title_font_size ?>px;
color: #333333;
padding-top: 0;
font-family: <?php echo $title_font_family ?>;
font-weight: <?php echo $title_font_weight ?>;
}
.hero-text {
padding: 20px 0 0 0;
font-size: <?php echo $font_size ?>px;
line-height: 150%;
color: #666666;
font-family: <?php echo $font_family ?>;
font-weight: <?php echo $font_weight ?>;
}
.hero-button-table {
background-color: <?php echo $button_background ?>;
/*border:1px solid #353535;*/
border-radius:5px;
}
.hero-button-td {
color: <?php echo $button_color ?>;
font-family:<?php echo $font_family ?>;
font-size:<?php echo $font_size ?>px;
font-weight:bold;
letter-spacing:-.5px;
line-height:150%;
padding-top:10px;
padding-right:30px;
padding-bottom:10px;
padding-left:30px;
}
.hero-button-a {
color:<?php echo $button_color ?>;
text-decoration:none;
}
</style>
<table width="290" align="left" class="hero-table">
<tr>
<td align="center" valign="top">
<img src="<?php echo $image ?>" border="0" alt="" style="max-width: 100%!important; height: auto!important; display: block;" class="img-max">
</td>
</tr>
</table>
<table width="290" align="right" class="hero-table hero-table-right">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" inline-class="hero-title">
<span><?php echo $options['title'] ?></span>
</td>
</tr>
<tr>
<td align="center" inline-class="hero-text">
<span><?php echo $options['text'] ?></span>
</td>
</tr>
</table>
<br>
<table border="0" cellpadding="0" cellspacing="0" align="center" inline-class="hero-button-table">
<tr>
<td align="center" valign="middle" inline-class="hero-button-td">
<a href="<?php echo esc_attr($url) ?>" target="_blank" inline-class="hero-button-a"><?php echo $button_label ?></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php } ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -0,0 +1,21 @@
<?php
/*
* @var $options array contains all the options the current block we're ediging contains
* @var $controls NewsletterControls
*/
/* @var $fields NewsletterFields */
?>
<?php $fields->select('layout', __('Layout', 'newsletter'), array('full' => 'Full', 'left' => 'Left'))?>
<?php $fields->media('image', __('Image', 'newsletter'))?>
<?php $fields->text('title', __('Title', 'newsletter')) ?>
<?php $fields->font('title_font')?>
<?php $fields->textarea('text', __('Text', 'newsletter')) ?>
<?php $fields->font('font')?>
<?php $fields->button('button', __('Button', 'newsletter'))?>
<?php $fields->block_commons() ?>

View File

@@ -0,0 +1,10 @@
@media all and (max-width: 525px) {
.hero-table {
width: 100%!important;
max-width: 100%!important;
}
.hero-table-right {
margin-top: 20px;
}
}

View File

@@ -0,0 +1,38 @@
<?php
/*
* Name: Html
* Section: content
* Description: Free HTML block
*
*/
/* @var $options array */
/* @var $wpdb wpdb */
$default_options = array(
'html'=>'<p>This is a piece of nice html code. You can use any tag, but be aware that email readers do not render everything.<p>',
'block_padding_left' => 15,
'block_padding_right' => 15,
'block_background' => '#ffffff',
'font_family' => 'Helvetica, Arial, sans-serif',
'font_size' => 16
);
$options = array_merge($default_options, $options);
?>
<style>
.html-td {
font-family: <?php echo $options['font_family']?>;
font-size: <?php echo $options['font_size']?>px;
color: <?php echo $options['font_color']?>;
}
</style>
<table width="100%" border="0" cellpadding="0" align="center" cellspacing="0">
<tr>
<td width="100%" valign="top" align="center" class="html-td">
<?php echo $options['html'] ?>
</td>
</tr>
</table>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,42 @@
<?php
/*
* @var $options array contains all the options the current block we're ediging contains
* @var $controls NewsletterControls
*/
$default_options = array(
'block_background'=>'#ffffff',
);
$options = array_merge($default_options, $options);
?>
<style>
.CodeMirror {
height: 400px;
}
</style>
<script>
var templateEditor;
jQuery(function () {
templateEditor = CodeMirror.fromTextArea(document.getElementById("options-html"), {
lineNumbers: true,
mode: 'htmlmixed',
lineWrapping: true,
extraKeys: {"Ctrl-Space": "autocomplete"}
});
});
</script>
<table class="form-table">
<tr>
<td>
<?php $controls->textarea('html') ?>
</td>
</tr>
</table>
<?php $fields->block_commons() ?>

View File

@@ -0,0 +1,4 @@
.html-td p {
font-family: Helvetica, Arial, sans-serif;
font-size: 16px;
}

View File

@@ -0,0 +1,43 @@
<?php
/*
* Name: Single image
* Section: content
* Description: A single image with link
*/
/* @var $options array */
/* @var $wpdb wpdb */
$defaults = array(
'image' => '',
'url' => '',
'block_background' => '#ffffff',
'block_padding_left' => 0,
'block_padding_right' => 0,
'block_padding_bottom' => 15,
'block_padding_top' => 15
);
$options = array_merge($defaults, $options);
$alt = '';
if (empty($options['image']['id'])) {
// A placeholder can be set by a preset and it is kept indefinitely
if (!empty($options['placeholder'])) {
$image = $options['placeholder'];
} else {
$image = 'https://source.unsplash.com/600x250/daily';
}
} else {
$image = tnp_media_resize($options['image']['id'], array(600, 0));
$alt = $options['image_alt'];
}
$url = $options['url'];
?>
<?php if (!empty($url)) { ?>
<a href="<?php echo $url ?>" target="_blank"><img src="<?php echo $image ?>" border="0" alt="" style="max-width: 100%!important; height: auto!important; display: inline-block;"></a>
<?php } else { ?>
<img src="<?php echo $image ?>" border="0" alt="<?php echo esc_attr($alt) ?>" style="max-width: 100%!important; height: auto!important; display: inline-block;">
<?php } ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -0,0 +1,14 @@
<?php
/* @var $options array contains all the options the current block we're ediging contains */
/* @var $controls NewsletterControls */
/* @var $fields NewsletterFields */
?>
<?php $controls->hidden('placeholder') ?>
<?php $fields->media('image', null, array('alt'=>true)) ?>
<?php $fields->url('url', 'URL') ?>
<?php $fields->block_commons() ?>

View File

@@ -0,0 +1,369 @@
<?php
/*
* Name: Last posts
* Section: content
* Description: Last posts list with different layouts
* Type: dynamic
*/
/* @var $options array */
/* @var $wpdb wpdb */
$defaults = array(
'title' => 'Last news',
'color' => '#999999',
'font_family' => 'Helvetica, Arial, sans-serif',
'font_size' => '16',
'font_color' => '#333333',
'title_font_family' => 'Helvetica, Arial, sans-serif',
'title_font_size' => '25',
'title_font_color' => ' #333333',
'max' => 4,
'button_label' => __('Read more...', 'newsletter'),
'categories' => '',
'tags' => '',
'block_background' => '#ffffff',
'layout' => 'one',
'language' => '',
'button_background' => '#256F9C',
'button_font_color' => '#ffffff',
'button_font_family' => 'Helvetica, Arial, sans-serif',
'button_font_size' => 16,
'block_padding_left' => 15,
'block_padding_right' => 15,
'block_padding_top' => 15,
'block_padding_bottom' => 15
);
$options = array_merge($defaults, $options);
$font_family = $options['font_family'];
$font_size = $options['font_size'];
$title_font_family = $options['title_font_family'];
$title_font_size = $options['title_font_size'];
$show_image = !empty($options['show_image']);
$filters = array();
$filters['posts_per_page'] = (int) $options['max'];
if (!empty($options['categories'])) {
$filters['category__in'] = $options['categories'];
}
if (!empty($options['tags'])) {
$filters['tag'] = $options['tags'];
}
// Filter by time?
//$options['block_last_run'] = time();
if (!empty($context['last_run'])) {
$filters['date_query'] = array(
'after' => gmdate('c', $context['last_run'])
);
}
$posts = Newsletter::instance()->get_posts($filters, $options['language']);
if ($context['type'] == 'automated') {
// No new posts
if (empty($posts)) {
if (isset($options['automated_required'])) {
$out['return_empty_message'] = true;
}
return;
}
if ($options['automated_include'] == 'max') {
unset($filters['date_query']);
$posts = Newsletter::instance()->get_posts($filters, $options['language']);
}
}
$out['subject'] = $posts[0]->post_title;
$button_background = $options['button_background'];
$button_label = $options['button_label'];
$button_font_family = $options['button_font_family'];
$button_font_size = $options['button_font_size'];
$button_color = $options['button_font_color'];
$alternative = plugins_url('newsletter') . '/emails/blocks/posts/images/blank.png';
$alternative_2 = plugins_url('newsletter') . '/emails/blocks/posts/images/blank-240x160.png';
remove_all_filters('excerpt_more');
?>
<?php if ($options['layout'] == 'one') { ?>
<style>
.posts-post-date {
padding: 0 0 5px 25px;
font-size: 13px;
font-family: <?php echo $font_family ?>;
font-weight: normal;
color: #aaaaaa;
}
.posts-post-title {
padding: 0 0 5px 25px;
font-size: <?php echo $title_font_size ?>px;
font-family: <?php echo $title_font_family ?>;
font-weight: normal;
color: <?php echo $options['title_font_color'] ?>;
line-height: normal;
}
.posts-post-excerpt {
padding: 10px 0 15px 25px;
font-family: <?php echo $font_family ?>;
color: <?php echo $options['font_color'] ?>;
font-size: <?php echo $font_size ?>px;
line-height: 1.5em;
}
.posts-button-table {
background-color: <?php echo $button_background ?>;
/*border:1px solid #353535;*/
border-radius:5px;
align: right;
}
.posts-button-td {
color: <?php echo $button_color ?>;
font-family:<?php echo $font_family ?>;
font-size:<?php echo $button_font_size ?>px;
font-weight:normal;
letter-spacing:normal;
line-height:normal;
padding-top:15px;
padding-right:30px;
padding-bottom:15px;
padding-left:30px;
text-align: right;
}
.posts-button-a {
color:<?php echo $button_color ?>;
font-size:<?php echo $button_font_size ?>px;
font-weight:normal;
text-decoration:none;
}
</style>
<!-- COMPACT ARTICLE SECTION -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="responsive-table">
<?php foreach ($posts as $post) { ?>
<?php
$url = tnp_post_permalink($post);
?>
<tr>
<?php if ($show_image) { ?>
<td valign="top" style="padding: 30px 0 0 0; width: 105px!important" class="mobile-hide">
<a href="<?php echo tnp_post_permalink($post) ?>" target="_blank">
<img src="<?php echo tnp_post_thumbnail_src($post, array(105, 105, true), $alternative) ?>" width="105" height="105" alt="Image" border="0" style="display: block; font-family: Arial; color: #666666; font-size: 14px; min-width: 105px!important; width: 105px!important;">
</a>
</td>
<?php } ?>
<td style="padding: 30px 0 0 0;" class="no-padding">
<!-- ARTICLE -->
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<?php if (!empty($options['show_date'])) { ?>
<tr>
<td align="left" inline-class="posts-post-date" class="padding-meta">
<?php echo tnp_post_date($post) ?>
</td>
</tr>
<?php } ?>
<tr>
<td align="left" inline-class="posts-post-title" class="padding-copy tnpc-row-edit" data-type="title">
<?php echo tnp_post_title($post) ?>
</td>
</tr>
<tr>
<td align="left" inline-class="posts-post-excerpt" class="padding-copy tnpc-row-edit" data-type="text">
<?php echo tnp_post_excerpt($post) ?>
</td>
</tr>
<tr>
<td align="left" class="padding">
<table border="0" cellpadding="0" cellspacing="0" inline-class="posts-button-table" align="right">
<tr>
<td align="center" valign="middle" inline-class="posts-button-td">
<a href="<?php echo esc_attr($url) ?>" target="_blank" inline-class="posts-button-a"><?php echo $button_label ?></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<?php } ?>
</table>
<?php } else { ?>
<style>
.posts-post-date {
padding: 10px 0 0 15px;
font-size: 13px;
font-family: <?php echo $font_family ?>;
font-weight: normal;
color: #aaaaaa;
}
.posts-post-title {
padding: 15px 0 0 0;
font-family: <?php echo $title_font_family ?>;
color: <?php echo $options['title_font_color'] ?>;
font-size: <?php echo $title_font_size ?>px;
line-height: 1.3em;
}
.posts-post-excerpt {
padding: 5px 0 0 0;
font-family: <?php echo $font_family ?>;
color: <?php echo $options['font_color'] ?>;
font-size: <?php echo $font_size ?>px;
line-height: 1.4em;
}
.posts-button-table {
background-color: <?php echo $button_background ?>;
/*border:1px solid #353535;*/
border-radius:5px;
align: right;
}
.posts-button-td {
color: <?php echo $button_color ?>;
font-family:<?php echo $font_family ?>;
font-size:<?php echo $button_font_size ?>px;
font-weight:normal;
letter-spacing:normal;
line-height:normal;
padding-top:15px;
padding-right:30px;
padding-bottom:15px;
padding-left:30px;
text-align: right;
}
.posts-button-a {
color:<?php echo $button_color ?>;
font-size:<?php echo $button_font_size ?>px;
font-weight:normal;
text-decoration:none;
}
</style>
<!-- TWO COLUMN SECTION -->
<!-- TWO COLUMNS -->
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<?php foreach (array_chunk($posts, 2) AS $row) { ?>
<tr>
<td valign="top" style="padding: 10px;" class="mobile-wrapper">
<!-- LEFT COLUMN -->
<table cellpadding="0" cellspacing="0" border="0" width="47%" align="left" class="responsive-table">
<tr>
<td style="padding: 20px 0 40px 0;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<?php if ($show_image) { ?>
<tr>
<td align="center" valign="middle" class="tnpc-row-edit" data-type="image">
<a href="<?php echo tnp_post_permalink($row[0]) ?>" target="_blank">
<img src="<?php echo tnp_post_thumbnail_src($row[0], array(240, 160, true), $alternative_2) ?>" alt="Image" width="240" height="160" border="0" class="img-max">
</a>
</td>
</tr>
<?php } ?>
<tr>
<td align="center" inline-class="posts-post-title" class="tnpc-row-edit" data-type="title"><?php echo tnp_post_title($row[0]) ?></td>
</tr>
<?php if (!empty($options['show_date'])) { ?>
<tr>
<td align="center" inline-class="posts-post-date">
<?php echo tnp_post_date($row[0]) ?>
</td>
</tr>
<?php } ?>
<tr>
<td align="center" inline-class="posts-post-excerpt" class="tnpc-row-edit" data-type="text"><?php echo tnp_post_excerpt($row[0]) ?></td>
</tr>
<tr>
<td align="center">
<br>
<table border="0" cellpadding="0" cellspacing="0" inline-class="posts-button-table" align="center">
<tr>
<td align="center" valign="middle" inline-class="posts-button-td">
<a href="<?php echo tnp_post_permalink($row[0]) ?>" target="_blank" inline-class="posts-button-a"><?php echo $button_label ?></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php if (!empty($row[1])) { ?>
<!-- RIGHT COLUMN -->
<table cellpadding="0" cellspacing="0" border="0" width="47%" align="right" class="responsive-table">
<tr>
<td style="padding: 20px 0 40px 0;">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<?php if ($show_image) { ?>
<tr>
<td align="center" valign="middle" class="tnpc-row-edit" data-type="image">
<a href="<?php echo tnp_post_permalink($row[1]) ?>" target="_blank">
<img src="<?php echo tnp_post_thumbnail_src($row[1], array(240, 160, true), $alternative_2) ?>" alt="Image" width="240" height="160" border="0" class="img-max">
</a>
</td>
</tr>
<?php } ?>
<tr>
<td align="center" inline-class="posts-post-title" class="tnpc-row-edit" data-type="title"><?php echo tnp_post_title($row[1]) ?></td>
</tr>
<?php if (!empty($options['show_date'])) { ?>
<tr>
<td align="center" inline-class="posts-post-date">
<?php echo tnp_post_date($row[1]) ?>
</td>
</tr>
<?php } ?>
<tr>
<td align="center" inline-class="posts-post-excerpt" class="tnpc-row-edit" data-type="text"><?php echo tnp_post_excerpt($row[1]) ?></td>
</tr>
<tr>
<td align="center">
<br>
<table border="0" cellpadding="0" cellspacing="0" inline-class="posts-button-table" align="center">
<tr>
<td align="center" valign="middle" inline-class="posts-button-td">
<a href="<?php echo tnp_post_permalink($row[1]) ?>" target="_blank" inline-class="posts-button-a"><?php echo $button_label ?></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php } ?>
</td>
</tr>
<?php } ?>
</table>
<?php } ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

View File

@@ -0,0 +1,38 @@
<?php
/* @var $options array contains all the options the current block we're ediging contains */
/* @var $controls NewsletterControls */
/* @var $fields NewsletterFields */
?>
<?php if ($context['type'] == 'automated') { ?>
<p>This is a dynamic block which is regenerated with the latest posts when Automated generate a new newsletter.</p>
<?php $fields->select('automated_include', __('What to include', 'newsletter'), array('new' => __('New posts after last newsletter', 'newsletter'),
'max' => __('Always max posts if at least one is new', 'newsletter')),
array('description'=>'This option is effective only when the newsletter is generated, not while composing')) ?>
<?php $fields->checkbox('automated_required', __('Required', 'newsletter'), array('description'=>'This block must return content or the newslettter has not to be sent')) ?>
<?php } ?>
<?php $fields->select('layout', __('Layout', 'newsletter'), array('one' => __('One column', 'newsletter'), 'two' => __('Two columns', 'newsletter'))) ?>
<?php $fields->font('title_font', __('Title font', 'newsletter')) ?>
<?php $fields->font('font', __('Excerpt font', 'newsletter')) ?>
<?php $fields->checkbox('show_image', __('Show image', 'newsletter')) ?>
<?php $fields->checkbox('show_date', __('Show date', 'newsletter')) ?>
<?php $fields->select_number('max', __('Max posts', 'newsletter'), 1, 40); ?>
<?php $fields->language(); ?>
<?php $fields->button('button', 'Button', array('url' => false)) ?>
<?php $fields->section(__('Filters', 'newsletter')) ?>
<?php $fields->categories(); ?>
<?php $fields->text('tags', __('Tags', 'newsletter')); ?>
<?php $fields->block_commons() ?>

View File

@@ -0,0 +1,60 @@
<?php
/*
* Name: Preheader
* Section: header
* Description: Preheader
*
*/
/* @var $options array */
/* @var $wpdb wpdb */
$default_options = array(
'view' => 'View online',
'text' => 'Few words summary',
'block_background' => '#ffffff',
'font_family' => $font_family,
'font_size' => 13,
'font_color' => '#999999',
'font_weight' => 'normal',
'block_padding_left'=>15,
'block_padding_right'=>15,
'block_padding_bottom'=>15,
'block_padding_top'=>15
);
$options = array_merge($default_options, $options);
?>
<style>
.preheader-table {
width: 100%!important
border: 0;
border-collapse: collapse;
}
.preheader-link {
padding: 10px;
font-size: <?php echo $options['font_size'] ?>px;
font-family: <?php echo $options['font_family'] ?>;
font-weight: <?php echo $options['font_weight'] ?>;
color: <?php echo $options['font_color'] ?>;
}
.preheader-view-link {
font-size: <?php echo $options['font_size'] ?>px;
font-family: <?php echo $options['font_family'] ?>;
font-weight: <?php echo $options['font_weight'] ?>;
color: <?php echo $options['font_color'] ?>;
text-decoration: none;
}
</style>
<table width="100%" border="0" cellpadding="0" align="center" cellspacing="0" inline-class="preheader-table">
<tr>
<td class="preheader-link" width="50%" valign="top" align="left">
<?php echo $options['text'] ?>
</td>
<td class="preheader-link" width="50%" valign="top" align="right">
<a href="{email_url}" target="_blank" rel="noopener" class="preheader-view-link"><?php echo $options['view'] ?></a>
</td>
</tr>
</table>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -0,0 +1,10 @@
<?php
/* @var $fields NewsletterFields */
?>
<?php $fields->text('text', __('Text', 'newsletter')) ?>
<?php $fields->text('view', __('View online', 'newsletter')) ?>
<?php $fields->font('font') ?>
<?php $fields->block_commons() ?>

View File

@@ -0,0 +1,31 @@
<?php
/*
* Name: Separator
* Section: content
* Description: Separator
*
*/
/* @var $options array */
$default_options = array(
'color'=>'#dddddd',
'height'=>1,
'block_padding_top'=>20,
'block_padding_bottom'=>20,
'block_padding_right'=>20,
'block_padding_left'=>20,
'block_background'=>'#ffffff'
);
$options = array_merge($default_options, $options);
?>
<table border="0" cellpadding="0" align="center" cellspacing="0" width="100%">
<tr>
<td style="border-bottom: <?php echo $options['height'] ?>px solid <?php echo $options['color'] ?>;"></td>
</tr>
</table>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,8 @@
<?php
/* @var $fields NewsletterFields */
?>
<?php $fields->color('color', __('Color', 'newsletter')) ?>
<?php $fields->select('height', __('Height', 'newsletter'), array('1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5)) ?>
<?php $fields->block_commons() ?>

View File

@@ -0,0 +1,117 @@
<?php
/*
* Name: Social links
* Section: footer
* Description: Link with icons to social profiles
*
*/
/* @var $options array */
/* @var $wpdb wpdb */
$default_options = array(
'block_padding_left' => 15,
'block_padding_right' => 15,
'block_padding_bottom' => 15,
'block_padding_top' => 15,
'block_background'=> '#ffffff'
);
$options = array_merge($default_options, $options);
$social_icon_url = plugins_url('newsletter') . '/emails/themes/default/images';
$configured = false;
?>
<table border="0" cellspacing="0" cellpadding="0" align="center" class="responsive-table">
<tr>
<td align="center">
<?php
if (!empty($block_options['facebook_url'])) {
$configured = true;
?>
<span class="tnpc-row-edit" data-type="image">
<a href="<?php echo $block_options['facebook_url'] ?>"><img src="<?php echo $social_icon_url ?>/facebook.png" alt="Facebook"></a>
</span>
<?php } ?>
<?php
if (!empty($block_options['twitter_url'])) {
$configured = true;
?>
<span class="tnpc-row-edit" data-type="image">
<a href="<?php echo $block_options['twitter_url'] ?>"><img src="<?php echo $social_icon_url ?>/twitter.png" alt="Twitter"></a>
</span>
<?php } ?>
<?php
if (!empty($block_options['googleplus_url'])) {
$configured = true;
?>
<span class="tnpc-row-edit" data-type="image">
<a href="<?php echo $block_options['googleplus_url'] ?>"><img src="<?php echo $social_icon_url ?>/googleplus.png" alt="Google+"></a>
</span>
<?php } ?>
<?php
if (!empty($block_options['pinterest_url'])) {
$configured = true;
?>
<span class="tnpc-row-edit" data-type="image">
<a href="<?php echo $block_options['pinterest_url'] ?>"><img src="<?php echo $social_icon_url ?>/pinterest.png" alt="Pinterest"></a>
</span>
<?php } ?>
<?php
if (!empty($block_options['linkedin_url'])) {
$configured = true;
?>
<span class="tnpc-row-edit" data-type="image">
<a href="<?php echo $block_options['linkedin_url'] ?>"><img src="<?php echo $social_icon_url ?>/linkedin.png" alt="LinkedIn"></a>
</span>
<?php } ?>
<?php
if (!empty($block_options['tumblr_url'])) {
$configured = true;
?>
<span class="tnpc-row-edit" data-type="image">
<a href="<?php echo $block_options['tumblr_url'] ?>"><img src="<?php echo $social_icon_url ?>/tumblr.png" alt="Tumblr"></a>
</span>
<?php } ?>
<?php
if (!empty($block_options['youtube_url'])) {
$configured = true;
?>
<span class="tnpc-row-edit" data-type="image">
<a href="<?php echo $block_options['youtube_url'] ?>"><img src="<?php echo $social_icon_url ?>/youtube.png" alt="Youtube"></a>
</span>
<?php } ?>
<?php
if (!empty($block_options['soundcloud_url'])) {
$configured = true;
?>
<span class="tnpc-row-edit" data-type="image">
<a href="<?php echo $block_options['soundcloud_url'] ?>"><img src="<?php echo $social_icon_url ?>/soundcloud.png" alt="SoundCloud"></a>
</span>
<?php } ?>
<?php
if (!empty($block_options['instagram_url'])) {
$configured = true;
?>
<span class="tnpc-row-edit" data-type="image">
<a href="<?php echo $block_options['instagram_url'] ?>"><img src="<?php echo $social_icon_url ?>/instagram.png" alt="Instagram"></a>
</span>
<?php } ?>
<?php
if (!empty($block_options['vimeo_url'])) {
$configured = true;
?>
<span class="tnpc-row-edit" data-type="image">
<a href="<?php echo $block_options['vimeo_url'] ?>"><img src="<?php echo $social_icon_url ?>/vimeo.png" alt="Vimeo"></a>
</span>
<?php } ?>
<?php if (!$configured) { ?>
<p>Configure your social links in the <a href="?page=newsletter_main_info">Social configuration section</a>.<br/>
Then remove and add again this block.</p>
<?php } ?>
</td>
</tr>
</table>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -0,0 +1,9 @@
<?php
/* @var $options array contains all the options the current block we're ediging contains */
/* @var $controls NewsletterControls */
/* @var $fields NewsletterFields */
?>
<p>Social profiles can be configured on company info panel.</p>
<?php $fields->block_commons() ?>

View File

@@ -0,0 +1,47 @@
<?php
/*
* Name: Text
* Section: content
* Description: Free text block
*
*/
/* @var $options array */
$default_options = array(
'html'=>'<p style="text-align: left; font-size: 16px; font-family: Arial">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vitae sodales nulla, nec blandit velit. Morbi feugiat imperdiet augue, vel mattis augue sagittis rutrum. Sed.</p>',
'font_family'=>'Helvetica, Arial, sans-serif',
'font_size'=>16,
'font_color'=>'#000000',
'block_padding_left'=>15,
'block_padding_right'=>15,
'block_background'=>'#ffffff'
);
$options = array_merge($default_options, $options);
/*
$options['html'] = str_replace('<p>', '<p style="">', $options['html']);
$style = 'font-family: ' . $options['font_family'] . ';font-size: ' . $options['font_size'] . 'px; color: <?php echo $options['font_color']?>;
$options['html'] = str_replace('<p', '<p inline-class="text-p"', $options['html']);
*/
?>
<style>
.text-td {
font-family: <?php echo $options['font_family']?>;
font-size: <?php echo $options['font_size']?>px;
color: <?php echo $options['font_color']?>;
line-height: 1.5rem;
}
.text-p {
font-family: <?php echo $options['font_family']?>;
font-size: <?php echo $options['font_size']?>px;
}
</style>
<table width="100%" style="width: 100%!important" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" valign="top" align="left" class="text-td">
<?php echo $options['html'] ?>
</td>
</tr>
</table>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,11 @@
<?php
/*
* @var $options array contains all the options the current block we're ediging contains
* @var $controls NewsletterControls
*/
/* @var $fields NewsletterFields */
?>
<?php //$fields->font() ?>
<?php $fields->wp_editor('html', 'Content') ?>
<?php $fields->block_commons() ?>

View File

@@ -0,0 +1,108 @@
<?php
defined('ABSPATH') || exit;
require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
$controls = new NewsletterControls();
$module = NewsletterEmails::instance();
wp_enqueue_style('tnpc-style', plugins_url('/tnp-composer/_css/newsletter-builder.css', __FILE__), array(), time());
wp_enqueue_style('tnpc-newsletter-style', home_url('/') . '?na=emails-composer-css');
include NEWSLETTER_INCLUDES_DIR . '/codemirror.php';
if ($controls->is_action()) {
if (empty($_GET['id'])) {
$email = array();
$email['status'] = 'new';
$email['track'] = Newsletter::instance()->options['track'];
$email['token'] = $module->get_token();
$email['message'] = $controls->data['body'];
$email['subject'] = $controls->data['subject'];
$email['message_text'] = 'This email requires a modern e-mail reader but you can view the email online here:
{email_url}.
Thank you, ' . wp_specialchars_decode(get_option('blogname'), ENT_QUOTES) . '
To change your subscription follow: {profile_url}.';
$email['editor'] = NewsletterEmails::EDITOR_COMPOSER;
$email['type'] = 'message';
$email['send_on'] = time();
$email['query'] = "select * from " . NEWSLETTER_USERS_TABLE . " where status='C'";
$email = Newsletter::instance()->save_email($email, ARRAY_A);
} else {
$email['id'] = $_GET['id'];
$email['editor'] = NewsletterEmails::EDITOR_COMPOSER;
$email['message'] = $controls->data['body'];
$email['subject'] = $controls->data['subject'];
$email = Newsletter::instance()->save_email($email, ARRAY_A);
}
$controls->add_message_saved();
/* * * Post save tasks ** */
if ($controls->is_action('test')) {
$module->send_test_email($module->get_email($email['id']), $controls);
}
if ($controls->is_action('preview')) {
$redirect = $module->get_admin_page_url('edit');
} else {
$redirect = $module->get_admin_page_url('composer');
}
$controls->js_redirect($redirect . '&id=' . $email['id']);
return;
} else {
if (!empty($_GET['id'])) {
$email = Newsletter::instance()->get_email((int) $_GET['id'], ARRAY_A);
$controls->data = $email;
}
}
if (isset($email)) {
$controls->data['body'] = $email['message'];
$controls->data['subject'] = $email['subject'];
}
?>
<div id="tnp-notification">
<?php
$controls->show();
$controls->messages = '';
$controls->errors = '';
?>
</div>
<div class="wrap tnp-emails-composer" id="tnp-wrap">
<?php $controls->composer_load('body', true); ?>
<div id="tnp-heading" class="tnp-composer-heading">
<div class="tnpc-logo">
<p>The Newsletter Plugin <strong>Composer</strong></p>
</div>
<div class="tnpc-controls">
<form method="post" action="" id="tnpc-form">
<?php $controls->init(); ?>
<?php $controls->composer_fields(); ?>
<?php $controls->button_confirm('reset', __('Back to last save', 'newsletter'), 'Are you sure?'); ?>
<?php $controls->button('save', __('Save', 'newsletter'), 'tnpc_save(this.form); this.form.submit();'); ?>
<?php $controls->button('preview', __('Next', 'newsletter') . ' &raquo;', 'tnpc_save(this.form); this.form.submit();'); ?>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,7 @@
<?php
// This file is used only on first installation!
$options = array(
'theme'=>'default'
);

View File

@@ -0,0 +1,499 @@
<?php
defined('ABSPATH') || exit;
/* @var $wpdb wpdb */
require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
$controls = new NewsletterControls();
$module = NewsletterEmails::instance();
function tnp_prepare_controls($email, $controls) {
$controls->data = $email;
foreach ($email['options'] as $name => $value) {
$controls->data['options_' . $name] = $value;
}
}
// Always required
$email = $module->get_email($_GET['id'], ARRAY_A);
if (empty($email)) {
echo 'Wrong email identifier';
return;
}
$email_id = $email['id'];
/* Satus changes which require a reload */
if ($controls->is_action('pause')) {
$wpdb->update(NEWSLETTER_EMAILS_TABLE, array('status' => 'paused'), array('id' => $email_id));
$email = $module->get_email($_GET['id'], ARRAY_A);
tnp_prepare_controls($email, $controls);
}
if ($controls->is_action('continue')) {
$wpdb->update(NEWSLETTER_EMAILS_TABLE, array('status' => 'sending'), array('id' => $email_id));
$email = $module->get_email($_GET['id'], ARRAY_A);
tnp_prepare_controls($email, $controls);
}
if ($controls->is_action('abort')) {
$wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set last_id=0, sent=0, status='new' where id=" . $email_id);
$email = $module->get_email($_GET['id'], ARRAY_A);
tnp_prepare_controls($email, $controls);
$controls->messages = __('Delivery definitively cancelled', 'newsletter');
}
if ($controls->is_action('change-private')) {
$data = array();
$data['private'] = $controls->data['private'] ? 1 : 0;
$data['id'] = $email['id'];
$email = Newsletter::instance()->save_email($data, ARRAY_A);
$controls->add_message_saved();
tnp_prepare_controls($email, $controls);
}
$editor_type = $module->get_editor_type($email);
// Backward compatibility: preferences conversion
if (!$controls->is_action()) {
if (!isset($email['options']['lists'])) {
$options_profile = get_option('newsletter_profile');
if (empty($controls->data['preferences_status_operator'])) {
$email['options']['lists_operator'] = 'or';
} else {
$email['options']['lists_operator'] = 'and';
}
$controls->data['options_lists'] = array();
$controls->data['options_lists_exclude'] = array();
if (!empty($email['preferences'])) {
$preferences = explode(',', $email['preferences']);
$value = empty($email['options']['preferences_status']) ? 'on' : 'off';
foreach ($preferences as $x) {
if ($value == 'on') {
$controls->data['options_lists'][] = $x;
} else {
$controls->data['options_lists_exclude'][] = $x;
}
}
}
}
}
// End backward compatibility
if (!$controls->is_action()) {
tnp_prepare_controls($email, $controls);
}
if ($controls->is_action('html')) {
$data = array();
$data['editor'] = NewsletterEmails::EDITOR_HTML;
$data['id'] = $email_id;
// Backward compatibility: clean up the composer flag
$data['options'] = $email['options'];
unset($data['options']['composer']);
// End backward compatibility
$email = Newsletter::instance()->save_email($data, ARRAY_A);
$controls->messages = 'You can now edit the newsletter as pure HTML';
tnp_prepare_controls($email, $controls);
$editor_type = NewsletterEmails::EDITOR_HTML;
}
if ($controls->is_action('test') || $controls->is_action('save') || $controls->is_action('send') || $controls->is_action('schedule')) {
$email['subject'] = $controls->data['subject'];
$email['track'] = $controls->data['track'];
$email['editor'] = $editor_type;
$email['private'] = $controls->data['private'];
$email['message_text'] = $controls->data['message_text'];
if ($controls->is_action('send')) {
$email['send_on'] = time();
} else {
$email['send_on'] = $controls->data['send_on'];
}
// Reset and refill the options
$email['options'] = array();
foreach ($controls->data as $name => $value) {
if (strpos($name, 'options_') === 0) {
$email['options'][substr($name, 8)] = $value;
}
}
// Before send, we build the query to extract subscriber, so the delivery engine does not
// have to worry about the email parameters
if ($email['options']['status'] == 'S') {
$query = "select * from " . NEWSLETTER_USERS_TABLE . " where status='S'";
} else {
$query = "select * from " . NEWSLETTER_USERS_TABLE . " where status='C'";
}
if ($email['options']['wp_users'] == '1') {
$query .= " and wp_user_id<>0";
}
$list_where = array();
if (isset($email['options']['lists']) && count($email['options']['lists'])) {
foreach ($email['options']['lists'] as $list) {
$list = (int) $list;
$list_where[] = 'list_' . $list . '=1';
}
}
if (!empty($list_where)) {
if (isset($email['options']['lists_operator']) && $email['options']['lists_operator'] == 'and') {
$query .= ' and (' . implode(' and ', $list_where) . ')';
} else {
$query .= ' and (' . implode(' or ', $list_where) . ')';
}
}
// Excluded lists
$list_where = array();
if (isset($email['options']['lists_exclude']) && count($email['options']['lists_exclude'])) {
foreach ($email['options']['lists_exclude'] as $list) {
$list = (int) $list;
$list_where[] = 'list_' . $list . '=0';
}
}
if (!empty($list_where)) {
// Must not be in one of the excluded lists
$query .= ' and (' . implode(' and ', $list_where) . ')';
}
// Gender
if (isset($email['options']['sex'])) {
$sex = $email['options']['sex'];
if (is_array($sex) && count($sex)) {
$query .= " and sex in (";
foreach ($sex as $x) {
$query .= "'" . esc_sql((string) $x) . "', ";
}
$query = substr($query, 0, -2);
$query .= ")";
}
}
// Temporary save to have an object and call the query filter
$e = Newsletter::instance()->save_email($email);
$query = apply_filters('newsletter_emails_email_query', $query, $e);
$email['query'] = $query;
if ($email['status'] == 'sent') {
$email['total'] = $email['sent'];
} else {
$email['total'] = $wpdb->get_var(str_replace('*', 'count(*)', $query));
}
if ($controls->is_action('send') && $controls->data['send_on'] < time()) {
$controls->data['send_on'] = time();
}
$email = Newsletter::instance()->save_email($email, ARRAY_A);
tnp_prepare_controls($email, $controls);
if ($email === false) {
$controls->errors = 'Unable to save. Try to deactivate and reactivate the plugin may be the database is out of sync.';
}
$controls->add_message_saved();
}
if ($controls->is_action('send') || $controls->is_action('schedule')) {
NewsletterStatistics::instance()->reset_stats($email);
if ($email['subject'] == '') {
$controls->errors = __('A subject is required to send', 'newsletter');
} else {
$wpdb->update(NEWSLETTER_EMAILS_TABLE, array('status' => 'sending'), array('id' => $email_id));
$email['status'] = 'sending';
if ($controls->is_action('send')) {
$controls->messages = __( 'Now sending.', 'newsletter' );
} else {
$controls->messages = __( 'Scheduled.', 'newsletter' );
}
}
}
if (isset($email['options']['status']) && $email['options']['status'] == 'S') {
$controls->warnings[] = __('This newsletter will be sent to not confirmed subscribers.', 'newsletter');
}
if (strpos($email['message'], '{profile_url}') === false && strpos($email['message'], '{unsubscription_url}') === false && strpos($email['message'], '{unsubscription_confirm_url}') === false) {
$controls->warnings[] = __('The message is missing the subscriber profile or cancellation link.', 'newsletter');
}
if ($email['status'] != 'sent') {
$subscriber_count = $wpdb->get_var(str_replace('*', 'count(*)', $email['query']));
} else {
$subscriber_count = $email['sent'];
}
?>
<style>
.select2-container {
max-width: 500px;
display: block;
margin: 1px;
margin-top: 5px;
}
</style>
<div class="wrap tnp-emails tnp-emails-edit" id="tnp-wrap">
<?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
<div id="tnp-heading">
<h2><?php _e('Edit Newsletter', 'newsletter') ?></h2>
</div>
<div id="tnp-body">
<form method="post" action="" id="newsletter-form">
<?php $controls->init(array('cookie_name' => 'newsletter_emails_edit_tab')); ?>
<div class="tnp-status-header">
<div class="tnp-two-thirds">
<div class="tnp-submit">
<?php if ($email['status'] == 'sending' || $email['status'] == 'sent') { ?>
<?php $controls->button_back('?page=newsletter_emails_index') ?>
<?php } else { ?>
<a class="button-primary" href="<?php echo $module->get_editor_url($email_id, $editor_type)?>">
<i class="fa fa-edit"></i> <?php _e('Edit', 'newsletter') ?>
</a>
<?php } ?>
<?php if ($email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_save(); ?>
<?php if ($email['status'] == 'new') { ?>
<?php $controls->button_confirm('send', __('Send now', 'newsletter'), __('Start real delivery?', 'newsletter')); ?>
<a id="tnp-schedule-button" class="button-secondary" href="javascript:tnp_toggle_schedule()"><i class="far fa-clock"></i> <?php _e("Schedule") ?></a>
<span id="tnp-schedule" style="display: none;">
<?php $controls->datetime('send_on') ?>
<?php $controls->button_confirm('schedule', __('Schedule', 'newsletter'), __('Schedule delivery?', 'newsletter')); ?>
<a class="button-secondary tnp-button-cancel" href="javascript:tnp_toggle_schedule()"><?php _e("Cancel") ?></a>
</span>
<?php } ?>
<?php if ($email['status'] == 'sending') $controls->button_confirm('pause', __('Pause', 'newsletter'), __('Pause the delivery?', 'newsletter')); ?>
<?php if ($email['status'] == 'paused') $controls->button_confirm('continue', __('Continue', 'newsletter'), 'Continue the delivery?'); ?>
<?php if ($email['status'] == 'paused') $controls->button_confirm('abort', __('Stop', 'newsletter'), __('This totally stop the delivery, ok?', 'newsletter')); ?>
</div>
<?php $controls->text('subject', null, 'Subject'); ?>
<a href="#" class="tnp-suggest-button" onclick="tnp_suggest_subject(); return false;"><?php _e('Get ideas', 'newsletter') ?></a>
<!--
<a href="#" class="tnp-suggest-button" onclick="tnp_emoji(); return false;"><?php _e('Insert emoji', 'newsletter') ?></a>
-->
</div>
<div class="tnp-one-third">
<div id="tnp-nl-status">
<span class="tnp-nl-status-title"><?php _e("Status:") ?></span>
<span class="tnp-nl-status-title-value"><?php _e("") ?> <?php $module->show_email_status_label($email) ?></span>
<?php $module->show_email_progress_bar($email, array('numbers' => $email['status'] == 'sent' ? false : true)) ?>
<?php if ($email['status'] == 'sent' || $email['status'] == 'sending') { ?>
<div class="tnp-nl-status-row">
<span class="tnp-nl-status-schedule-value"><?php if ($email['status'] == 'sent') {
echo __('Sent on'), ' ', $module->format_date( $email['send_on']);
} else if ($email['status'] == 'sending' && $email['send_on'] > time()) {
echo __('Scheduled on'), ' ', $module->format_date( $email['send_on']);
}
?></span>
</div>
<?php } ?>
<div class="tnp-nl-status-row">
<span class="tnp-nl-status-schedule-targeting"><?php _e('Targeted subscribers', 'newsletter') ?>:</span>
<span class="tnp-nl-status-schedule-value"><?php echo $subscriber_count ?></span>
</div>
</div>
</div>
</div>
<div id="tabs">
<ul>
<li><a href="#tabs-options"><?php _e('Sending Options', 'newsletter') ?></a></li>
<li><a href="#tabs-advanced"><?php _e('Advanced', 'newsletter') ?></a></li>
<li><a href="#tabs-preview"><?php _e('Preview', 'newsletter') ?></a></li>
</ul>
<div id="tabs-options" class="tnp-list-conditions">
<p>
<?php $controls->panel_help('https://www.thenewsletterplugin.com/documentation/newsletter-targeting') ?>
</p>
<p>
<?php _e('Leaving all multichoice options unselected is like to select all them', 'newsletter'); ?>
</p>
<table class="form-table">
<tr>
<th><?php _e('Lists', 'newsletter') ?></th>
<td>
<?php
$lists = $controls->get_list_options();
?>
<?php $controls->select('options_lists_operator', array('or' => __('Match at least one of', 'newsletter'), 'and' => __('Match all of', 'newsletter'))); ?>
<?php $controls->select2('options_lists', $lists, null, true, null, __('All', 'newsletter')); ?>
<br>
<?php _e('must not in one of', 'newsletter') ?>
<?php $controls->select2('options_lists_exclude', $lists, null, true, null, __('None', 'newsletter')); ?>
</td>
</tr>
<tr>
<th><?php _e('Gender', 'newsletter') ?></th>
<td>
<?php $controls->checkboxes_group('options_sex', array('f' => 'Women', 'm' => 'Men', 'n' => 'Not specified')); ?>
</td>
</tr>
<tr>
<th><?php _e('Status', 'newsletter') ?></th>
<td>
<?php $controls->select('options_status', array('C' => __('Confirmed', 'newsletter'), 'S' => __('Not confirmed', 'newsletter'))); ?>
</td>
</tr>
<tr>
<th><?php _e('Only to subscribers linked to WP users', 'newsletter') ?></th>
<td>
<?php $controls->yesno('options_wp_users'); ?>
</td>
</tr>
</table>
<?php do_action('newsletter_emails_edit_target', $module->get_email($email_id), $controls) ?>
</div>
<div id="tabs-advanced">
<table class="form-table">
<tr>
<th><?php _e('Keep private', 'newsletter') ?></th>
<td>
<?php $controls->yesno('private'); ?>
<?php if ($email['status'] == 'sent') { ?>
<?php $controls->button('change-private', __('Toggle')) ?>
<?php } ?>
<p class="description">
<?php _e('Hide/show from public sent newsletter list.', 'newsletter') ?>
<?php _e('Required', 'newsletter') ?>: <a href="" target="_blank">Newsletter Archive Extension</a>
</p>
</td>
</tr>
<tr>
<th><?php _e('Track clicks and message opening', 'newsletter') ?></th>
<td>
<?php $controls->yesno('track'); ?>
</td>
</tr>
</table>
<?php do_action('newsletter_emails_edit_other', $module->get_email($email_id), $controls) ?>
<table class="form-table">
<tr>
<th>Query (tech)</th>
<td><?php echo esc_html($email['query']); ?></td>
</tr>
<tr>
<th>Token (tech)</th>
<td><?php echo esc_html($email['token']); ?></td>
</tr>
<tr>
<th>This is the textual version of your newsletter. If you empty it, only an HTML version will be sent but is an anti-spam best practice to include a text only version.</th>
<td>
<?php if (Newsletter::instance()->options['phpmailer'] == 0) { ?>
<p class="tnp-tab-warning">The text part is sent only when Newsletter manages directly the sending process. <a href="admin.php?page=newsletter_main_main" target="_blank">See the main settings</a>.</p>
<?php } ?>
<?php $controls->textarea_fixed('message_text', '100%', '500'); ?>
</td>
</tr>
</table>
</div>
<div id="tabs-preview">
<div class="tnpc-preview">
<!-- Flat Laptop Browser -->
<div class="fake-browser-ui">
<div class="frame">
<span class="bt-1"></span>
<span class="bt-2"></span>
<span class="bt-3"></span>
</div>
<iframe id="tnpc-preview-desktop" src="" width="700" height="520" alt="" frameborder="0"></iframe>
</div>
<!-- Flat Mobile Browser -->
<div class="fake-mobile-browser-ui">
<iframe id="tnpc-preview-mobile" src="" width="320" height="445" alt="" frameborder="0"></iframe>
<div class="frame">
<span class="bt-4"></span>
</div>
</div>
</div>
<script type="text/javascript">
preview_url = ajaxurl + "?action=tnpc_preview&id=<?php echo $email_id ?>";
jQuery('#tnpc-preview-desktop, #tnpc-preview-mobile').attr("src", preview_url);
setTimeout(function () {
jQuery('#tnpc-preview-desktop, #tnpc-preview-mobile').contents().find("a").click(function (e) {
e.preventDefault();
})
}, 500);
</script>
<p>
<?php if ($editor_type != NewsletterEmails::EDITOR_HTML && $email['status'] != 'sending' && $email['status'] != 'sent') $controls->button_confirm('html', __('Convert to HTML newsletter', 'newsletter'), 'Attention: no way back!'); ?>
</p>
</div>
</div>
</form>
</div>
<?php include NEWSLETTER_DIR . '/emails/subjects.php'; ?>
<?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
</div>

View File

@@ -0,0 +1,15 @@
/* The CSS used for the WP editor on administration panels */
body {
font-size: 16px;
font-family: sans-serif;
margin: 20px;
}
.mce-content-body p, table, ul, ol {
margin-bottom: 15px;
line-height: 24px;
}
img {
max-width: 100%;
}

View File

@@ -0,0 +1,105 @@
<?php
defined('ABSPATH') || exit;
require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
$controls = new NewsletterControls();
$module = NewsletterEmails::instance();
$email_id = (int) $_GET['id'];
if ($controls->is_action('save') || $controls->is_action('next') || $controls->is_action('test')) {
$email['id'] = $email_id;
$email['message'] = $controls->data['message'];
$email['subject'] = $controls->data['subject'];
$module->save_email($email);
if ($controls->is_action('next')) {
$controls->js_redirect($module->get_admin_page_url('edit') . '&id=' . $email_id);
return;
}
}
if ($controls->is_action('test')) {
$module->send_test_email($module->get_email($email_id), $controls);
}
$controls->data = Newsletter::instance()->get_email($email_id, ARRAY_A);
?>
<?php include NEWSLETTER_INCLUDES_DIR . '/codemirror.php'; ?>
<style>
.CodeMirror {
height: 600px;
margin-top: 15px;
margin-bottom: 15px;
}
</style>
<script>
var templateEditor;
jQuery(function () {
templateEditor = CodeMirror.fromTextArea(document.getElementById("options-message"), {
lineNumbers: true,
mode: 'htmlmixed',
lineWrapping: true,
extraKeys: {"Ctrl-Space": "autocomplete"}
});
});
function tnp_media(name) {
var tnp_uploader = wp.media({
title: "Select an image",
button: {
text: "Select"
},
frame: 'post',
multiple: false,
displaySetting: true,
displayUserSettings: true
}).on("insert", function () {
wp.media;
var media = tnp_uploader.state().get("selection").first();
if (media.attributes.url.indexOf("http") !== 0)
media.attributes.url = "http:" + media.attributes.url;
if (!media.attributes.mime.startsWith("image")) {
templateEditor.getDoc().replaceRange(url, templateEditor.getDoc().getCursor());
} else {
var display = tnp_uploader.state().display(media);
var url = media.attributes.sizes[display.attributes.size].url;
templateEditor.getDoc().replaceRange('<img src="' + url + '">', templateEditor.getDoc().getCursor());
}
}).open();
}
</script>
<div id="tnp-notification">
<?php $controls->show(); ?>
</div>
<div class="wrap tnp-emails-editor-html" id="tnp-wrap">
<form action="" method="post">
<?php $controls->init() ?>
<?php $controls->text('subject', 60, 'Newsletter subject') ?>
<a href="#" class="button-primary" onclick="tnp_suggest_subject(); return false;"><?php _e('Get ideas', 'newsletter') ?></a>
<a href="#" class="button-primary" onclick="newsletter_textarea_preview('options-message'); return false;"><i class="fa fa-eye"></i></a>
<input type="button" class="button-primary" value="Add media" onclick="tnp_media()">
<?php $controls->textarea_preview('message', '100%', 700, '', '', false); ?>
<div style="text-align: right ">
<?php $controls->button_confirm('reset', __('Back to last save', 'newsletter'), 'Are you sure?'); ?>
<?php $controls->button('test', __('Test', 'newsletter')); ?>
<?php $controls->button('save', __('Save', 'newsletter')); ?>
<?php $controls->button('next', __('Next', 'newsletter') . ' &raquo;'); ?>
</div>
</form>
<?php include NEWSLETTER_DIR . '/emails/subjects.php'; ?>
</div>

View File

@@ -0,0 +1,119 @@
<?php
defined('ABSPATH') || exit;
require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
$controls = new NewsletterControls();
$module = NewsletterEmails::instance();
$email_id = (int) $_GET['id'];
if ($controls->is_action('save') || $controls->is_action('next')) {
$email['id'] = $email_id;
$email['message'] = $controls->data['message'];
$email['subject'] = $controls->data['subject'];
$module->save_email($email);
if ($controls->is_action('next')) {
$controls->js_redirect($module->get_admin_page_url('edit') . '&id=' . $email_id);
return;
}
}
if ($controls->is_action('test')) {
$module->send_test_email($module->get_email($email_id), $controls);
}
$controls->data = Newsletter::instance()->get_email($email_id, ARRAY_A);
?>
<style>
.mce-tinymce {
margin-top: 15px;
margin-bottom: 15px;
}
</style>
<script src="<?php echo plugins_url('newsletter') ?>/vendor/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
// https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
tinymce.init({
height: 600,
mode: "specific_textareas",
editor_selector: "visual",
statusbar: true,
allow_conditional_comments: true,
table_toolbar: "tableprops tablecellprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | " +
"tableinsertcolbefore tableinsertcolafter tabledeletecol",
toolbar: "formatselect fontselect fontsizeselect | bold italic underline strikethrough forecolor backcolor | alignleft alignright aligncenter alignjustify | bullist numlist | link unlink | image",
//theme: "advanced",
entity_encoding: "raw",
image_advtab: true,
image_title: true,
plugins: "table fullscreen legacyoutput textcolor colorpicker link image code lists advlist fullpage",
relative_urls: false,
convert_urls: false,
remove_script_host: false,
document_base_url: "<?php echo esc_js(get_option('home')) ?>/",
content_css: ["<?php echo plugins_url('newsletter') ?>/emails/editor.css", "<?php echo home_url('/') . '?na=emails-css&id=' . $email_id . '&' . time(); ?>"]
});
</script>
<script>
function tnp_media() {
var tnp_uploader = wp.media({
title: "Select an image",
button: {
text: "Select"
},
frame: 'post',
multiple: false,
displaySetting: true,
displayUserSettings: true
}).on("insert", function () {
wp.media;
var media = tnp_uploader.state().get("selection").first();
if (media.attributes.url.indexOf("http") !== 0)
media.attributes.url = "http:" + media.attributes.url;
if (!media.attributes.mime.startsWith("image")) {
tinyMCE.execCommand('mceInsertLink', false, media.attributes.url);
} else {
var display = tnp_uploader.state().display(media);
var url = media.attributes.sizes[display.attributes.size].url;
tinyMCE.execCommand('mceInsertContent', false, '<img src="' + url + '" style="max-width: 100%">');
}
}).open();
}
</script>
<div id="tnp-notification">
<?php $controls->show(); ?>
</div>
<div class="wrap tnp-emails-editor-html" id="tnp-wrap">
<form action="" method="post">
<?php $controls->init() ?>
<?php $controls->text('subject', 60, 'Newsletter subject')?>
<a href="#" class="button-primary" onclick="tnp_suggest_subject(); return false;"><?php _e('Get ideas', 'newsletter') ?></a>
<input type="button" class="button-primary" value="Add media" onclick="tnp_media()">
<?php $controls->editor('message', 30); ?>
<div style="text-align: right ">
<?php $controls->button_confirm('reset', __('Back to last save', 'newsletter'), 'Are you sure?'); ?>
<?php $controls->button('test', __('Test', 'newsletter')); ?>
<?php $controls->button('save', __('Save', 'newsletter')); ?>
<?php $controls->button('next', __('Next', 'newsletter') . ' &raquo;'); ?>
</div>
</form>
<?php include NEWSLETTER_DIR . '/emails/subjects.php'; ?>
</div>

View File

@@ -0,0 +1,999 @@
<?php
defined('ABSPATH') || exit;
require_once NEWSLETTER_INCLUDES_DIR . '/themes.php';
require_once NEWSLETTER_INCLUDES_DIR . '/module.php';
class NewsletterEmails extends NewsletterModule {
static $instance;
const EDITOR_COMPOSER = 2;
const EDITOR_HTML = 1;
const EDITOR_TINYMCE = 0;
static $PRESETS_LIST;
/**
* @return NewsletterEmails
*/
static function instance() {
if (self::$instance == null) {
self::$instance = new NewsletterEmails();
}
return self::$instance;
}
function __construct() {
self::$PRESETS_LIST = array("cta", "invite", "announcement", "posts", "sales", "product", "tour", "simple", "blank");
$this->themes = new NewsletterThemes('emails');
parent::__construct('emails', '1.1.5');
add_action('wp_loaded', array($this, 'hook_wp_loaded'));
if (is_admin()) {
add_action('wp_ajax_tnpc_render', array($this, 'tnpc_render_callback'));
add_action('wp_ajax_tnpc_preview', array($this, 'tnpc_preview_callback'));
add_action('wp_ajax_tnpc_css', array($this, 'tnpc_css_callback'));
add_action('wp_ajax_tnpc_options', array($this, 'hook_wp_ajax_tnpc_options'));
add_action('wp_ajax_tnpc_presets', array($this, 'hook_wp_ajax_tnpc_presets'));
// Thank you to plugins which add the WP editor on other admin plugin pages...
if (isset($_GET['page']) && $_GET['page'] == 'newsletter_emails_edit') {
global $wp_actions;
$wp_actions['wp_enqueue_editor'] = 1;
}
}
}
function options_decode($options) {
// Start compatibility
if (is_string($options) && strpos($options, 'options[') !== false) {
$opts = array();
parse_str($options, $opts);
$options = $opts['options'];
}
// End compatibility
if (is_array($options)) {
return $options;
}
$tmp = json_decode($options, true);
if (is_null($tmp)) {
return json_decode(base64_decode($options), true);
} else {
return $tmp;
}
}
/**
*
* @param array $options Options array
*/
function options_encode($options) {
return base64_encode(json_encode($options, JSON_HEX_TAG | JSON_HEX_AMP));
}
function hook_wp_ajax_tnpc_options() {
global $wpdb;
// TODO: Uniform to use id everywhere
if (!isset($_REQUEST['id']))
$_REQUEST['id'] = $_REQUEST['b'];
$block = $this->get_block($_REQUEST['id']);
if (!$block) {
die('Block not found with id ' . esc_html($_REQUEST['id']));
}
if (!class_exists('NewsletterControls')) {
include NEWSLETTER_INCLUDES_DIR . '/controls.php';
}
$options = $this->options_decode(stripslashes_deep($_REQUEST['options']));
$context = array('type'=>'');
if (isset($_REQUEST['context_type'])) $context['type'] = $_REQUEST['context_type'];
// $defaults = array(
// 'block_padding_top' => 15,
// 'block_padding_bottom' => 15,
// 'block_padding_right' => 0,
// 'block_padding_left' => 0,
// 'block_background' => '#ffffff'
// );
//
// $options = array_merge($defaults, $options);
$controls = new NewsletterControls($options);
$fields = new NewsletterFields($controls);
$controls->init();
echo '<input type="hidden" name="action" value="tnpc_render">';
echo '<input type="hidden" name="b" value="' . esc_attr($_REQUEST['id']) . '">';
ob_start();
include $block['dir'] . '/options.php';
$content = ob_get_clean();
echo "<h2>", esc_html($block["name"]), "</h2>";
echo $content;
wp_die();
}
/**
* Retrieves the presets list (no id in GET) or a specific preset id in GET)
*
* @return string
*/
function hook_wp_ajax_tnpc_presets() {
$content = "";
if (!empty($_REQUEST['id'])) {
// Preset render
$preset = $this->get_preset($_REQUEST['id']);
foreach ($preset->blocks as $item) {
$this->render_block($item->block, true, (array) $item->options);
}
} else {
$content = "<div class='clear tnpc-presets-title'>" . __('Choose a preset:', 'newsletter') . "</div>";
foreach (self::$PRESETS_LIST as $id) {
$preset = $this->get_preset($id);
$content .= "<div class='tnpc-preset' onclick='tnpc_load_preset(\"$id\")'>";
$content .= "<img src='$preset->icon' title='$preset->name' />";
$content .= "<span class='tnpc-preset-label'>$preset->name</span>";
$content .= '</div>';
}
$content .= '<div class="clear"></div>';
echo $content;
}
wp_die();
}
function has_dynamic_blocks($theme) {
preg_match_all('/data-json="(.*?)"/m', $theme, $matches, PREG_PATTERN_ORDER);
foreach ($matches[1] as $match) {
$a = html_entity_decode($match, ENT_QUOTES, 'UTF-8');
$options = $this->options_decode($a);
$block = $this->get_block($options['block_id']);
if (!$block) {
continue;
}
if ($block['type'] == 'dynamic')
return true;
}
return false;
}
/**
* Regenerates a saved composed email rendering each block. Regeneration is
* conditioned (possibly) by the context. The context is usually passed to blocks
* so they can act in the right manner.
*
* The last run parameter can instruct the block to generate content conditioned to
* the passed timestamp (for example limiting the content to new posts from the last
* run timestamp).
*
* @param string $theme (Rinominare)
* @return string
*/
function regenerate($theme, $context = array()) {
$this->logger->debug('Starting email regeneration');
$this->logger->debug($context);
if (empty($theme)) {
$this->logger->debug('The email was empty');
return array('body' => '', 'subject' => '');
}
$context = array_merge(array('last_run' => 0, 'type' => ''), $context);
preg_match_all('/data-json="(.*?)"/m', $theme, $matches, PREG_PATTERN_ORDER);
$result = '';
$all_empty = true; // If all dynamic content blocks return an empty html
$has_dynamic_blocks = false;
$subject = '';
foreach ($matches[1] as $match) {
$a = html_entity_decode($match, ENT_QUOTES, 'UTF-8');
$options = $this->options_decode($a);
$block = $this->get_block($options['block_id']);
if (!$block) {
$this->logger->debug('Unable to load the block ' . $options['block_id']);
continue;
}
ob_start();
$out = $this->render_block($options['block_id'], true, $options, $context);
if ($out['return_empty_message']) {
return '';
}
if (empty($subject) && !empty($out['subject'])) {
$subject = $out['subject'];
}
$block_html = ob_get_clean();
$result .= $block_html;
// If a dynamic block return something, we need to return a regenerated template
if ($block['type'] == 'dynamic') {
$has_dynamic_blocks = true;
if (!empty($block_html)) {
$all_empty = false;
}
}
}
if (!empty($context['last_run']) && $has_dynamic_blocks && $all_empty) {
return '';
}
$x = strpos($theme, '<body');
if ($x !== false) {
$x = strpos($theme, '>', $x);
$result = substr($theme, 0, $x + 1) . $result . '</body></html>';
} else {
}
return array('body' => $result, 'subject' => $subject);
}
function remove_block_data($text) {
// TODO: Lavorare!
return $text;
}
/**
* Renders a block identified by its id, using the block options and adding a wrapper
* if required (for the first block rendering.
* @param type $block_id
* @param type $wrapper
* @param type $options
*/
function render_block($block_id = null, $wrapper = false, $options = array(), $context = array()) {
include_once NEWSLETTER_INCLUDES_DIR . '/helper.php';
$width = 600;
$font_family = 'Helvetica, Arial, sans-serif';
$info = Newsletter::instance()->get_options('info');
// Just in case...
if (!is_array($options)) {
$options = array();
}
$block_options = get_option('newsletter_main');
$block = $this->get_block($block_id);
// Block not found
if (!$block) {
if ($wrapper) {
echo '<table border="0" cellpadding="0" cellspacing="0" align="center" width="100%" style="border-collapse: collapse; width: 100%;" class="tnpc-row tnpc-row-block" data-id="', esc_attr($block_id), '">';
echo '<tr>';
echo '<td data-options="" bgcolor="#ffffff" align="center" style="padding: 0; font-family: Helvetica, Arial, sans-serif;" class="edit-block">';
}
echo '<!--[if mso]><table border="0" cellpadding="0" align="center" cellspacing="0" width="' . $width . '"><tr><td width="' . $width . '"><![endif]-->';
echo "\n";
echo 'Block not found';
echo "<!--[if mso]></td></tr></table><![endif]-->\n";
if ($wrapper) {
echo '</td></tr></table>';
}
return;
}
$out = array('subject' => '', 'return_empty_message'=>false);
ob_start();
$logger = $this->logger;
include $block['dir'] . '/block.php';
$content = trim(ob_get_clean());
if (empty($content)) {
return $out;
}
$common_defaults = array(
'block_padding_top' => 0,
'block_padding_bottom' => 0,
'block_padding_right' => 0,
'block_padding_left' => 0,
'block_background' => '#ffffff'
);
$options = array_merge($common_defaults, $options);
// Obsolete
$content = str_replace('{width}', $width, $content);
$content = $this->inline_css($content, true);
// CSS driven by the block
// Requited for the server side parsing and rendering
$options['block_id'] = $block_id;
$options['block_padding_top'] = (int) str_replace('px', '', $options['block_padding_top']);
$options['block_padding_bottom'] = (int) str_replace('px', '', $options['block_padding_bottom']);
$options['block_padding_right'] = (int) str_replace('px', '', $options['block_padding_right']);
$options['block_padding_left'] = (int) str_replace('px', '', $options['block_padding_left']);
// Internal TD wrapper
$style = 'text-align: center; ';
$style .= 'width: 100%!important; ';
$style .= 'padding-top: ' . $options['block_padding_top'] . 'px; ';
$style .= 'padding-left: ' . $options['block_padding_left'] . 'px; ';
$style .= 'padding-right: ' . $options['block_padding_right'] . 'px; ';
$style .= 'padding-bottom: ' . $options['block_padding_bottom'] . 'px; ';
$style .= 'background-color: ' . $options['block_background'] . ';';
$data = $this->options_encode($options);
// First time block creation wrapper
if ($wrapper) {
echo '<table type="block" border="0" cellpadding="0" cellspacing="0" align="center" width="100%" style="border-collapse: collapse; width: 100%;" class="tnpc-row tnpc-row-block" data-id="', esc_attr($block_id), '">', "\n";
echo "<tr>";
echo '<td align="center" style="padding: 0;" class="edit-block">', "\n";
}
// Container that fixes the width and makes the block responsive
echo '<!--[if mso]><table border="0" cellpadding="0" align="center" cellspacing="0" width="' . $width . '"><tr><td width="' . $width . '"><![endif]-->';
echo "\n";
echo '<table type="options" data-json="', esc_attr($data), '" class="tnpc-block-content" border="0" cellpadding="0" align="center" cellspacing="0" width="100%" style="width: 100%!important; max-width: ', $width, 'px!important">', "\n";
echo "<tr>";
echo '<td align="center" style="', $style, '" bgcolor="', $options['block_background'], '" width="100%">', "\n";
//echo "<!-- block generated content -->\n";
echo $content;
//echo "\n<!-- /block generated content -->\n";
echo "\n</td></tr></table>";
echo '<!--[if mso]></td></tr></table><![endif]-->';
// First time block creation wrapper
if ($wrapper) {
echo "</td></tr></table>";
}
echo "\n";
return $out;
}
/**
* Ajax call to render a block with a new set of options after the settings popup
* has been saved.
*
* @param type $block_id
* @param type $wrapper
*/
function tnpc_render_callback() {
$block_id = $_POST['b'];
$wrapper = isset($_POST['full']);
if (isset($_POST['options']) && is_array($_POST['options'])) {
$options = stripslashes_deep($_POST['options']);
} else {
$options = array();
}
$this->render_block($block_id, $wrapper, $options);
wp_die();
}
function tnpc_preview_callback() {
$email = Newsletter::instance()->get_email($_REQUEST['id'], ARRAY_A);
if (empty($email)) {
echo 'Wrong email identifier';
return;
}
echo $email['message'];
wp_die(); // this is required to terminate immediately and return a proper response
}
function tnpc_css_callback() {
include NEWSLETTER_DIR . '/emails/tnp-composer/css/newsletter.css';
wp_die(); // this is required to terminate immediately and return a proper response
}
/** Returns the correct admin page to edit the newsletter with the correct editor. */
function get_editor_url($email_id, $editor_type) {
switch ($editor_type) {
case NewsletterEmails::EDITOR_COMPOSER: return admin_url("admin.php") . '?page=newsletter_emails_composer&id=' . $email_id;
case NewsletterEmails::EDITOR_HTML: return admin_url("admin.php") . '?page=newsletter_emails_editorhtml&id=' . $email_id;
case NewsletterEmails::EDITOR_TINYMCE: return admin_url("admin.php") . '?page=newsletter_emails_editortinymce&id=' . $email_id;
}
}
/**
* Returns the button linked to the correct "edit" page for the passed newsletter. The edit page can be an editor
* or the targeting page (it depends on newsletter status).
*
* @param TNP_Email $email
*/
function get_edit_button($email) {
$editor_type = $this->get_editor_type($email);
if ($email->status == 'new') {
$edit_url = $this->get_editor_url($email->id, $editor_type);
} else {
$edit_url = 'admin.php?page=newsletter_emails_edit&id=' . $email->id;
}
switch ($editor_type) {
case NewsletterEmails::EDITOR_COMPOSER:
$icon_class = 'th-large';
break;
case NewsletterEmails::EDITOR_HTML:
$icon_class = 'code';
break;
default:
$icon_class = 'edit';
break;
}
return '<a class="button-primary" href="' . $edit_url . '">' .
'<i class="fa fa-' . $icon_class . '"></i> ' . __('Edit', 'newsletter') . '</a>';
}
/** Returns the correct editor type for the provided newsletter. Contains backward compatibility code. */
function get_editor_type($email) {
$email = (object) $email;
$editor_type = $email->editor;
// Backward compatibility
$email_options = maybe_unserialize($email->options);
if (isset($email_options['composer'])) {
$editor_type = NewsletterEmails::EDITOR_COMPOSER;
}
// End backward compatibility
return $editor_type;
}
function hook_wp_loaded() {
global $wpdb;
$newsletter = Newsletter::instance();
switch ($newsletter->action) {
case 'v':
case 'view':
$email = $this->get_email($_GET['id']);
if (empty($email)) {
header("HTTP/1.0 404 Not Found");
die('Email not found');
}
$user = NewsletterSubscription::instance()->get_user_from_request();
if (!is_user_logged_in() || !(current_user_can('editor') || current_user_can('administrator'))) {
if ($email->status == 'new') {
header("HTTP/1.0 404 Not Found");
die('Not sent yet');
}
if ($email->private == 1) {
if (!$user) {
header("HTTP/1.0 404 Not Found");
die('No available for online view');
}
$sent = $wpdb->get_row($wpdb->prepare("select * from " . NEWSLETTER_SENT_TABLE . " where email_id=%d and user_id=%d limit 1", $email->id, $user->id));
if (!$sent) {
header("HTTP/1.0 404 Not Found");
die('No available for online view');
}
}
}
header('Content-Type: text/html;charset=UTF-8');
header('X-Robots-Tag: noindex,nofollow,noarchive');
header('Cache-Control: no-cache,no-store,private');
echo $newsletter->replace($email->message, $user, $email);
die();
break;
case 'emails-css':
$email_id = (int) $_GET['id'];
$body = Newsletter::instance()->get_email_field($email_id, 'message');
$x = strpos($body, '<style');
if ($x === false)
return;
$x = strpos($body, '>', $x);
$y = strpos($body, '</style>');
header('Content-Type: text/css;charset=UTF-8');
echo substr($body, $x + 1, $y - $x - 1);
die();
break;
case 'emails-composer-css':
header('Cache: no-cache');
header('Content-Type: text/css');
echo $this->get_composer_css();
die();
break;
case 'emails-preview':
if (!Newsletter::instance()->is_allowed()) {
die('Not enough privileges');
}
if (!check_admin_referer('view')) {
die();
}
// Used by theme code
$theme_options = $this->get_current_theme_options();
$theme_url = $this->get_current_theme_url();
header('Content-Type: text/html;charset=UTF-8');
include($this->get_current_theme_file_path('theme.php'));
die();
break;
case 'emails-preview-text':
header('Content-Type: text/plain;charset=UTF-8');
if (!Newsletter::instance()->is_allowed()) {
die('Not enough privileges');
}
if (!check_admin_referer('view')) {
die();
}
// Used by theme code
$theme_options = $this->get_current_theme_options();
$file = $this->get_current_theme_file_path('theme-text.php');
if (is_file($file)) {
include($this->get_current_theme_file_path('theme-text.php'));
}
die();
break;
case 'emails-create':
if (!Newsletter::instance()->is_allowed()) {
die('Not enough privileges');
}
require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
$controls = new NewsletterControls();
if ($controls->is_action('create')) {
$this->save_options($controls->data);
$email = array();
$email['status'] = 'new';
$email['subject'] = ''; //__('Here the email subject', 'newsletter');
$email['track'] = 1;
$theme_options = $this->get_current_theme_options();
$theme_url = $this->get_current_theme_url();
$theme_subject = '';
ob_start();
include $this->get_current_theme_file_path('theme.php');
$email['message'] = ob_get_clean();
if (!empty($theme_subject)) {
$email['subject'] = $theme_subject;
}
ob_start();
include $this->get_current_theme_file_path('theme-text.php');
$email['message_text'] = ob_get_clean();
$email['type'] = 'message';
$email['send_on'] = time();
$email = $newsletter->save_email($email);
$edit_url = $this->get_editor_url($email->id, $email->editor);
header('Location: ' . $edit_url);
}
die();
break;
}
}
function upgrade() {
global $wpdb, $charset_collate;
parent::upgrade();
$this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " change column `type` `type` varchar(50) not null default ''");
$this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column token varchar(10) not null default ''");
$this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " drop column visibility");
$this->upgrade_query("alter table " . NEWSLETTER_EMAILS_TABLE . " add column private tinyint(1) not null default 0");
// Force a token to email without one already set.
//$token = self::get_token();
//$wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set token='" . $token . "' where token=''");
if ($this->old_version < '1.1.5') {
$this->upgrade_query("update " . NEWSLETTER_EMAILS_TABLE . " set type='message' where type=''");
$wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set token=''");
}
$wpdb->query("update " . NEWSLETTER_EMAILS_TABLE . " set total=sent where status='sent' and type='message'");
return true;
}
function admin_menu() {
$this->add_menu_page('index', 'Newsletters');
$this->add_admin_page('list', 'Email List');
$this->add_admin_page('new', 'Email New');
$this->add_admin_page('edit', 'Email Edit');
$this->add_admin_page('theme', 'Email Themes');
$this->add_admin_page('composer', 'The Composer');
$this->add_admin_page('editorhtml', 'HTML Editor');
$this->add_admin_page('editortinymce', 'TinyMCE Editor');
//$this->add_admin_page('cpreview', 'The Composer Preview');
}
/**
* Returns the current selected theme.
*/
function get_current_theme() {
$theme = $this->options['theme'];
if (empty($theme))
return 'blank';
else
return $theme;
}
function get_current_theme_options() {
$theme_options = $this->themes->get_options($this->get_current_theme());
// main options merge
$main_options = Newsletter::instance()->options;
foreach ($main_options as $key => $value) {
$theme_options['main_' . $key] = $value;
}
$info_options = Newsletter::instance()->get_options('info');
foreach ($info_options as $key => $value) {
$theme_options['main_' . $key] = $value;
}
return $theme_options;
}
/**
* Returns the file path to a theme using the theme overriding rules.
* @param type $theme
* @param type $file
*/
function get_theme_file_path($theme, $file) {
return $this->themes->get_file_path($theme);
}
function get_current_theme_file_path($file) {
return $this->themes->get_file_path($this->get_current_theme(), $file);
}
function get_current_theme_url() {
return $this->themes->get_theme_url($this->get_current_theme());
}
/**
* Returns true if the emails database still contain old 2.5 format emails.
*
* @return boolean
*/
function has_old_emails() {
return $this->store->get_count(NEWSLETTER_EMAILS_TABLE, "where type='email'") > 0;
}
function convert_old_emails() {
global $newsletter;
$list = $newsletter->get_emails('email', ARRAY_A);
foreach ($list as &$email) {
$email['type'] = 'message';
$query = "select * from " . NEWSLETTER_USERS_TABLE . " where status='C'";
if ($email['list'] != 0)
$query .= " and list_" . $email['list'] . "=1";
$email['preferences'] = $email['list'];
if (!empty($email['sex'])) {
$query .= " and sex='" . $email['sex'] . "'";
}
$email['query'] = $query;
$newsletter->save_email($email);
}
}
function build_block($dir) {
$file = basename($dir);
$block_id = sanitize_key($file);
$full_file = $dir . '/block.php';
if (!is_file($full_file)) {
return new WP_Error('1', 'Missing block.php file in ' . $dir);
}
if (!is_file($dir . '/icon.png')) {
$relative_dir = substr($dir, strlen(WP_CONTENT_DIR));
$data['icon'] = content_url($relative_dir . '/icon.png');
}
$data = get_file_data($full_file, array('name' => 'Name', 'section' => 'Section', 'description' => 'Description', 'type' => 'Type'));
$defaults = array('section' => 'content', 'name' => $file, 'descritpion' => '', 'icon' => NEWSLETTER_URL . '/images/block-icon.png', 'content' => '');
$data = array_merge($defaults, $data);
if (is_file($dir . '/icon.png')) {
$relative_dir = substr($dir, strlen(WP_CONTENT_DIR));
$data['icon'] = content_url($relative_dir . '/icon.png');
}
$data['id'] = $block_id;
// Absolute path of the block files
$data['dir'] = $dir;
return $data;
}
function scan_blocks_dir($dir) {
if (!is_dir($dir)) {
return array();
}
$handle = opendir($dir);
$list = array();
$relative_dir = substr($dir, strlen(WP_CONTENT_DIR));
while ($file = readdir($handle)) {
if ($file == '.' || $file == '..')
continue;
$data = $this->build_block($dir . '/' . $file);
if (is_wp_error($data)) {
$this->logger->error($data);
continue;
}
$list[$data['id']] = $data;
}
closedir($handle);
return $list;
}
/**
* Array of arrays with every registered block and legacy block converted to the new
* format.
*
* @return array
*/
function get_blocks() {
static $blocks = null;
if (!is_null($blocks))
return $blocks;
$blocks = $this->scan_blocks_dir(__DIR__ . '/blocks');
$extended = $this->scan_blocks_dir(WP_CONTENT_DIR . '/extensions/newsletter/blocks');
$blocks = array_merge($extended, $blocks);
$dirs = apply_filters('newsletter_blocks_dir', array());
$this->logger->debug('Block dirs: ' . print_r($dirs, true));
foreach ($dirs as $dir) {
$dir = str_replace('\\', '/', $dir);
$list = $this->scan_blocks_dir($dir);
$blocks = array_merge($list, $blocks);
}
do_action('newsletter_register_blocks');
foreach (TNP_Composer::$block_dirs as $dir) {
$block = $this->build_block($dir);
if (is_wp_error($block)) {
$this->logger->error($block);
continue;
}
if (!isset($blocks[$block['id']])) {
$blocks[$block['id']] = $block;
} else {
$this->logger->error('The block "' . $block['id'] . '" is already registered');
}
}
$blocks = array_reverse($blocks);
return $blocks;
}
/**
* Return a single block (associative array) checking for legacy ID as well.
*
* @param string $id
* @return array
*/
function get_block($id) {
switch ($id) {
case 'content-03-text.block':
$id = 'text';
break;
case 'footer-03-social.block':
$id = 'social';
break;
case 'footer-02-canspam.block':
$id = 'canspam';
break;
case 'content-05-image.block':
$id = 'image';
break;
case 'header-01-header.block':
$id = 'header';
break;
case 'footer-01-footer.block':
$id = 'footer';
break;
case 'content-02-heading.block':
$id = 'heading';
break;
case 'content-07-twocols.block':
case 'content-06-posts.block':
$id = 'posts';
break;
case 'content-04-cta.block': $id = 'cta';
break;
case 'content-01-hero.block': $id = 'hero';
break;
// case 'content-02-heading.block': $id = '/plugins/newsletter/emails/blocks/heading';
// break;
}
// Conversion for old full path ID
$id = sanitize_key(basename($id));
// TODO: Correct id for compatibility
$blocks = $this->get_blocks();
if (!isset($blocks[$id])) {
return null;
}
return $blocks[$id];
}
function scan_presets_dir($dir = null) {
if (is_null($dir)) {
$dir = __DIR__ . '/presets';
}
if (!is_dir($dir)) {
return array();
}
$handle = opendir($dir);
$list = array();
$relative_dir = substr($dir, strlen(WP_CONTENT_DIR));
while ($file = readdir($handle)) {
if ($file == '.' || $file == '..')
continue;
// The block unique key, we should find out how to build it, maybe an hash of the (relative) dir?
$preset_id = sanitize_key($file);
$full_file = $dir . '/' . $file . '/preset.json';
if (!is_file($full_file)) {
continue;
}
$icon = content_url($relative_dir . '/' . $file . '/icon.png');
$list[$preset_id] = $icon;
}
closedir($handle);
return $list;
}
function get_preset($id, $dir = null) {
if (is_null($dir)) {
$dir = __DIR__ . '/presets';
}
$id = $this->sanitize_file_name($id);
if (!is_dir($dir . '/' . $id) || !in_array($id, self::$PRESETS_LIST)) {
return array();
}
$json_content = file_get_contents("$dir/$id/preset.json");
$json_content = str_replace("{placeholder_base_url}", plugins_url('newsletter') . '/emails/presets', $json_content);
$json = json_decode($json_content);
$json->icon = NEWSLETTER_URL . "/emails/presets/$id/icon.png";
return $json;
}
function get_composer_css() {
$css = file_get_contents(__DIR__ . '/tnp-composer/css/newsletter.css');
$blocks = $this->get_blocks();
foreach ($blocks as $block) {
if (!file_exists($block['dir'] . '/style.css')) {
continue;
}
$css .= "\n\n";
$css .= "/* " . $block['name'] . " */\n";
$css .= file_get_contents($block['dir'] . '/style.css');
}
return $css;
}
function send_test_email($email, $controls) {
if (!$email) {
$controls->errors = __('Newsletter should be saved before send a test', 'newsletter');
return;
}
if ($email->subject == '') {
$email->subject = '[TEST] Dummy subject, it was empty (remember to set it)';
} else {
$email->subject = $email->subject . ' (TEST)';
}
$users = NewsletterUsers::instance()->get_test_users();
if (count($users) == 0) {
$controls->errors = '' . __('There are no test subscribers to send to', 'newsletter') .
'. <a href="https://www.thenewsletterplugin.com/plugins/newsletter/subscribers-module#test" target="_blank"><strong>' .
__('Read more', 'newsletter') . '</strong></a>.';
} else {
$r = Newsletter::instance()->send($email, $users, true);
$emails = array();
foreach ($users as $user) {
$emails[] = '<a href="admin.php?page=newsletter_users_edit&id=' . $user->id . '" target="_blank">' . $user->email . '</a>';
}
if (is_wp_error($r)) {
$controls->errors = 'Something went wrong. Check the error logs on status page.<br>';
$controls->errors .= __('Test subscribers:', 'newsletter');
$controls->errors .= ' ' . implode(', ', $emails);
$controls->errors .= '<br>';
$controls->errors .= '<strong>' . esc_html($r->get_error_message()) . '</strong><br>';
$controls->errors .= '<a href="https://www.thenewsletterplugin.com/documentation/email-sending-issues" target="_blank"><strong>' . __('Read more about delivery issues', 'newsletter') . '</strong></a>.';
} else {
$controls->messages = __('Test subscribers:', 'newsletter');
$controls->messages .= ' ' . implode(', ', $emails);
$controls->messages .= '.<br>';
$controls->messages .= '<a href="https://www.thenewsletterplugin.com/documentation/subscribers#test" target="_blank"><strong>' .
__('Read more about test subscribers', 'newsletter') . '</strong></a>.<br>';
$controls->messages .= '<a href="https://www.thenewsletterplugin.com/documentation/email-sending-issues" target="_blank"><strong>' . __('Read more about delivery issues', 'newsletter') . '</strong></a>.';
}
}
}
}
NewsletterEmails::instance();

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -0,0 +1,116 @@
<?php
defined('ABSPATH') || exit;
require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
$controls = new NewsletterControls();
$module = NewsletterEmails::instance();
if ($controls->is_action('copy')) {
$original = Newsletter::instance()->get_email($_POST['btn']);
$email = array();
$email['subject'] = $original->subject;
$email['message'] = $original->message;
$email['message_text'] = $original->message_text;
$email['send_on'] = time();
$email['type'] = 'message';
$email['editor'] = $original->editor;
$email['track'] = $original->track;
$email['options'] = $original->options;
$module->save_email($email);
$controls->messages .= __('Message duplicated.', 'newsletter');
}
if ($controls->is_action('delete')) {
$module->delete_email($_POST['btn']);
$controls->add_message_deleted();
}
if ($controls->is_action('delete_selected')) {
$r = Newsletter::instance()->delete_email($_POST['ids']);
$controls->messages .= $r . ' message(s) deleted';
}
$emails = $module->get_emails('message');
?>
<div class="wrap tnp-emails tnp-emails-index" id="tnp-wrap">
<?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
<div id="tnp-heading">
<h2><?php _e('Newsletters', 'newsletter') ?></h2>
</div>
<div id="tnp-body">
<form method="post" action="">
<?php $controls->init(); ?>
<p>
<a href="<?php echo $module->get_admin_page_url('theme'); ?>" class="button-primary"><?php _e('New newsletter', 'newsletter') ?></a>
<?php $controls->button_confirm('delete_selected', __('Delete selected newsletters', 'newsletter')); ?>
</p>
<table class="widefat tnp-newsletters-list" style="width: 100%">
<thead>
<tr>
<th>&nbsp;</th>
<th>Id</th>
<th><?php _e('Subject', 'newsletter') ?></th>
<th><?php _e('Status', 'newsletter') ?></th>
<th><?php _e('Progress', 'newsletter') ?>&nbsp;(*)</th>
<th><?php _e('Date', 'newsletter') ?></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
foreach ($emails as $email) { ?>
<tr>
<td><input type="checkbox" name="ids[]" value="<?php echo $email->id; ?>"/></td>
<td><?php echo $email->id; ?></td>
<td><?php
if ($email->subject)
echo htmlspecialchars($email->subject);
else
echo "Newsletter #" . $email->id;
?>
</td>
<td>
<?php $module->show_email_status_label($email) ?>
</td>
<td>
<?php $module->show_email_progress_bar($email, array('numbers'=>true)) ?>
</td>
<td><?php if ($email->status == 'sent' || $email->status == 'sending') echo $module->format_date($email->send_on); ?></td>
<td>
<?php echo $module->get_edit_button($email) ?>
</td>
<td>
<a class="button-primary" href="<?php echo NewsletterStatistics::instance()->get_statistics_url($email->id); ?>"><i class="fa fa-chart-bar"></i> <?php _e('Statistics', 'newsletter') ?></a>
</td>
<td><a class="button-primary" target="_blank" rel="noopener" href="<?php echo home_url('/')?>?na=view&id=<?php echo $email->id; ?>"><i class="fa fa-eye"></i>&nbsp;<?php _e('View', 'newsletter')?></a></td>
<td><?php $controls->button_copy($email->id); ?></td>
<td><?php $controls->button_delete($email->id); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<p>
(*) <?php _e('Expected total at the end of the delivery may differ due to subscriptions/unsubscriptions occurred meanwhile.', 'newsletter') ?>
</p>
</form>
</div>
<?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
</div>

View File

@@ -0,0 +1,182 @@
<?php
require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
$controls = new NewsletterControls();
$module = NewsletterEmails::instance();
if ($controls->is_action('theme')) {
if ($controls->data['theme'] != 'rawhtml') {
$controls->merge($module->themes->get_options($controls->data['theme']));
$module->save_options($controls->data);
}
// If this theme has no intermediate options...
if ($controls->data['theme'] == 'rawhtml' || !file_exists($module->get_current_theme_file_path('theme-options.php'))) {
$email = array();
$email['status'] = 'new';
$email['subject'] = __('Here the email subject', 'newsletter');
$email['track'] = Newsletter::instance()->options['track'];
$email['token'] = $module->get_token();
if ($controls->data['theme'] == 'rawhtml') {
$email['editor'] = NewsletterEmails::EDITOR_HTML;
$email['message'] = "<!DOCTYPE html>\n<html>\n<head>\n<title>Your email title</title>\n</head>\n<body>\n</body>\n</html>";
} else {
$theme_options = $module->get_current_theme_options();
$theme_url = $module->get_current_theme_url();
$theme_subject = '';
ob_start();
include $module->get_current_theme_file_path('theme.php');
$email['message'] = ob_get_clean();
if (!empty($theme_subject)) {
$email['subject'] = $theme_subject;
}
$file = $module->get_current_theme_file_path('theme-text.php');
if (file_exists($file)) {
ob_start();
include $module->get_current_theme_file_path('theme-text.php');
$email['message_text'] = ob_get_clean();
} else {
$email['message_text'] = 'You need a modern email client to read this email. Read it online: {email_url}.';
}
$email['editor'] = NewsletterEmails::EDITOR_TINYMCE;
}
$email['type'] = 'message';
$email['send_on'] = time();
$email = Newsletter::instance()->save_email($email);
$controls->js_redirect($module->get_editor_url($email->id, $email->editor));
return;
}
}
if ($controls->is_action('save')) {
$module->save_options($controls->data);
//$controls->messages = 'Saved.';
}
if ($controls->is_action('create')) {
$module->save_options($controls->data);
$email = array();
$email['status'] = 'new';
$email['subject'] = __('Here the email subject', 'newsletter');
$email['track'] = Newsletter::instance()->options['track'];
$theme_options = $module->get_current_theme_options();
$theme_url = $module->get_current_theme_url();
$theme_subject = '';
ob_start();
include $module->get_current_theme_file_path('theme.php');
$email['message'] = ob_get_clean();
if (!empty($theme_subject)) {
$email['subject'] = $theme_subject;
}
ob_start();
include $module->get_current_theme_file_path('theme-text.php');
$email['message_text'] = ob_get_clean();
$email['type'] = 'message';
$email['send_on'] = time();
$email = Newsletter::instance()->save_email($email);
?>
<script>
location.href = "<?php echo $module->get_admin_page_url('edit'); ?>&id=<?php echo $email->id; ?>";
</script>
<div class="wrap">
<p><a href="<?php echo $module->get_admin_page_url('edit'); ?>&id=<?php echo $email->id; ?>">click here to proceed</a>.</p>
</div>
<?php
return;
}
if ($controls->data == null) {
$controls->data = $module->get_options();
}
function newsletter_emails_update_options($options) {
add_option('newsletter_emails', '', null, 'no');
update_option('newsletter_emails', $options);
}
function newsletter_emails_update_theme_options($theme, $options) {
$x = strrpos($theme, '/');
if ($x !== false) {
$theme = substr($theme, $x + 1);
}
add_option('newsletter_emails_' . $theme, '', null, 'no');
update_option('newsletter_emails_' . $theme, $options);
}
function newsletter_emails_get_options() {
$options = get_option('newsletter_emails', array());
return $options;
}
function newsletter_emails_get_theme_options($theme) {
$x = strrpos($theme, '/');
if ($x !== false) {
$theme = substr($theme, $x + 1);
}
$options = get_option('newsletter_emails_' . $theme, array());
return $options;
}
?>
<div class="wrap tnp-emails tnp-emails-new" id="tnp-wrap">
<?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
<div id="tnp-heading">
<h2><?php _e('Create a newsletter', 'newsletter') ?>
<a class="tnp-btn-h1" href="<?php echo NewsletterEmails::instance()->get_admin_page_url('theme'); ?>"><?php _e('Back to newsletter themes', 'newsletter') ?></a>
</h2>
<br>
<p>Theme options are saved for next time you'll use this theme.</p>
</div>
<div id="tnp-body" class="tnp-body-lite">
<form method="post" action="">
<?php $controls->init(); ?>
<?php $controls->hidden('theme'); ?>
<table style="width: 100%; border-collapse: collapse">
<tr>
<td style="text-align: left; vertical-align: top; border-bottom: 1px solid #ddd; padding-bottom: 10px">
<div style="float: right; margin-left: 15px;"><?php $controls->button_primary('save', __('Refresh the preview', 'newsletter')); ?></div>
</td>
<td style="text-align: left; vertical-align: top; border-bottom: 1px solid #ddd; padding-bottom: 10px">
<div style="float: right"><?php $controls->button_primary('create', 'Proceed to edit &raquo;', 'this.form.action=\'' . home_url('/', is_ssl() ? 'https' : 'http') . '?na=emails-create\';this.form.submit()'); ?></div>
<img style="position: relative; left: 5px; top: 10px;"src="<?php echo plugins_url('newsletter') ?>/images/arrow.png" height="35">
</td>
</tr>
<tr>
<td style="width: 500px; vertical-align: top;">
<div class="tnp-emails-theme-options">
<?php @include $module->get_current_theme_file_path('theme-options.php'); ?>
</div>
</td>
<td style="vertical-align: top; padding-top: 15px; padding-left: 15px">
<iframe src="<?php echo wp_nonce_url(home_url('/', is_ssl() ? 'https' : 'http') . '?na=emails-preview&ts=' . time(), 'view'); ?>" height="700" style="width: 100%; border: 1px solid #ccc"></iframe>
</td>
</tr>
</table>
</form>
</div>
<?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

View File

@@ -0,0 +1,50 @@
{
"name": "A big announcement",
"blocks": [
{
"block": "header",
"options": {
}
},
{
"block": "heading",
"options": {
"text": "The day has come!",
"font_size": 36,
"font_weight": "bold"
}
},
{
"block": "text",
"options": {
"html": "<p style=\"text-align: center;\"><span style=\"font-size: 16px; font-family: arial,helvetica,sans-serif;\">We are incredibly excited to share with you some big news: our [new service] is finally here for you!</span></p>",
"block_padding_left": 30,
"block_padding_right": 30
}
},
{
"block": "cta",
"options": {
"text": "Find out now!",
"background": "#589776"
}
},
{
"block": "image",
"options": {
"placeholder": "{placeholder_base_url}/announcement/images/announcement.jpg"
}
},
{
"block": "footer",
"options": {
}
},
{
"block": "canspam",
"options": {
"block_background": "#ececec"
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,4 @@
{
"name": "Start with an empty project",
"blocks": []
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1,42 @@
{
"name": "Simple Call To Action",
"blocks": [
{
"block": "header",
"options": {
}
},
{
"block": "image",
"options": {
"placeholder": "{placeholder_base_url}/cta/images/cta-image-1200x240.jpg"
}
},
{
"block": "cta",
"options": {
"text": "Follow us",
"background": "#9bc091"
}
},
{
"block": "text",
"options": {
"html": "<p style=\"text-align: center;\"><span style=\"font-size: 16px; font-family: arial,helvetica,sans-serif;\">Subscribe to our Instagram account to stay updated with our style tips and keep your outfit cool.</span></p>",
"block_padding_left": 30,
"block_padding_right": 30
}
},
{
"block": "footer",
"options": {
}
},
{
"block": "canspam",
"options": {
"block_background": "#ececec"
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

View File

@@ -0,0 +1,63 @@
{
"name": "Invite to an event",
"blocks": [
{
"block": "header",
"options": {
}
},
{
"block": "text",
"options": {
"html": "<p style=\"text-align: center;\"><span style=\"font-size: 16px; font-family: arial,helvetica,sans-serif;\">My event brief description</span></p>",
"block_padding_left": 30,
"block_padding_right": 30
}
},
{
"block": "heading",
"options": {
"text": "You are invited to [my event]"
}
},
{
"block": "cta",
"options": {
"background": "#4dbcba",
"text": "RSVP"
}
},
{
"block": "image",
"options": {
"placeholder": "{placeholder_base_url}/invite/images/image.jpg"
}
},
{
"block": "text",
"options": {
"html": "<p style=\"text-align: center;\"><span style=\"font-size: 16px; font-family: arial,helvetica,sans-serif;\">Were throwing a backyard BBQ and everyone is cooking up their best dish. Join us this Sunday for dinner as we grill, smoke and fry up traditional summer favorites with a playful twist…</span></p>",
"block_padding_left": 30,
"block_padding_right": 30
}
},
{
"block": "cta",
"options": {
"background": "#4dbcba",
"text": "RSVP"
}
},
{
"block": "footer",
"options": {
}
},
{
"block": "canspam",
"options": {
"block_background": "#ececec"
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,32 @@
{
"name": "Last news from your blog",
"blocks": [
{
"block": "header",
"options": {
}
},
{
"block": "heading",
"options": {
"text": "Latest post from {blog_title}",
"font_weight": "bold"
}
},
{
"block": "posts",
"options": {
"show_image": 1,
"show_date": 2,
"button_background": "#62A2C9",
"block_padding_right": 30,
"block_padding_bottom": 30
}
},
{
"block": "footer",
"options": {
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -0,0 +1,117 @@
{
"name": "Product",
"blocks": [
{
"block": "header",
"options": {
}
},
{
"block": "heading",
"options": {
"text": "Drink healthy!",
"font_size": 40,
"font_weight": "bold",
"font_family": "Tahoma, Geneva, sans-serif"
}
},
{
"block": "image",
"options": {
"placeholder": "{placeholder_base_url}/product/images/product.jpg"
}
},
{
"block": "text",
"options": {
"html": "<p style=\"text-align: center;\"><span style=\"font-size: 24px; font-family: arial,helvetica,sans-serif;\">A juice like you've never seen before!</span></p>",
"block_padding_left": 30,
"block_padding_right": 30
}
},
{
"block": "cta",
"options": {
"background": "#CD4E74",
"text": "Discover the taste",
"font_size": 24,
"width": "300px"
}
},
{
"block": "heading",
"options": {
"text": "Highlands freshness",
"font_size": 30,
"font_family": "Tahoma, Geneva, sans-serif"
}
},
{
"block": "text",
"options": {
"html": "<p style=\"text-align: center;\"><span style=\"font-size: 19px; font-family: arial,helvetica,sans-serif;\">Chill out with this herbs flavoured juice with a lime twist.</span></p>",
"block_padding_left": 30,
"block_padding_right": 30
}
},
{
"block": "image",
"options": {
"placeholder": "{placeholder_base_url}/product/images/product-2.jpg"
}
},
{
"block": "heading",
"options": {
"text": "Deep forest experience",
"font_size": 30,
"font_family": "Tahoma, Geneva, sans-serif"
}
},
{
"block": "text",
"options": {
"html": "<p style=\"text-align: center;\"><span style=\"font-size: 19px; font-family: arial,helvetica,sans-serif;\">Feel the wild forest perfumes in your mouth.</span></p>",
"block_padding_left": 30,
"block_padding_right": 30
}
},
{
"block": "image",
"options": {
"placeholder": "{placeholder_base_url}/product/images/product-3.jpg"
}
},
{
"block": "text",
"options": {
"html": "<p style=\"text-align: center;\"><span style=\"font-size: 19px; font-family: arial,helvetica,sans-serif;\">Our juices qualities</span></p>",
"block_padding_left": 30,
"block_padding_right": 30
}
},
{
"block": "text",
"options":
{
"font_family":"Helvetica, Arial, sans-serif",
"block_padding_top":"10",
"block_padding_bottom":"20",
"block_padding_left":"60",
"block_padding_right":"60",
"html": "<ul style=\"list-style: disc;\">\n<li>100% <strong>organic</strong></li>\n<li>100% <strong>recyclable</strong> bottle</li>\n<li>no <strong>preservatives</strong> and <strong>additives</strong></li>\n<li>crafted with <strong>sustainable</strong> philosophy</li>\n</ul>"
}
},
{
"block": "footer",
"options": {
}
},
{
"block": "canspam",
"options": {
"block_background": "#ececec"
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@@ -0,0 +1,49 @@
{
"name": "A big offer",
"blocks": [
{
"block": "heading",
"options": {
"text": "Only 3 days left!",
"font_size": 40,
"font_weight": "bold",
"block_padding_top": 40,
"block_padding_bottom": 30
}
},
{
"block": "text",
"options": {
"html": "<p style=\"text-align: center;\"><span style=\"font-size: 16px; font-family: arial,helvetica,sans-serif;\">Last chance to get it! Last call to get up to 50% off.</span></p>",
"block_padding_left": 30,
"block_padding_right": 30
}
},
{
"block": "cta",
"options": {
"background": "#F799A3",
"text": "Get it",
"font_size": 26,
"font_weight": "bold"
}
},
{
"block": "image",
"options": {
"placeholder": "{placeholder_base_url}/sales/images/sales.jpg"
}
},
{
"block": "footer",
"options": {
}
},
{
"block": "canspam",
"options": {
"block_background": "#ececec"
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,51 @@
{
"name": "Story or full article",
"blocks": [
{
"block": "header",
"options": {
}
},
{
"block": "heading",
"options": {
"text": "Once upon a time",
"font_size": 48,
"font_weight": "bold",
"font_color": "#878787",
"block_padding_left": 15,
"block_padding_top": 80,
"block_padding_bottom": 20,
"block_padding_right": 15
}
},
{
"block": "text",
"options": {
"html": "<p style='font-size: 14px; text-align: center'>by Your Name</p>",
"block_padding_left": 15,
"block_padding_right": 15
}
},
{
"block": "text",
"options": {
"html": "<p style='font-size: 16px; text-align: left'>One thing was certain, that the white kitten had had nothing to do with it:—it was the black kittens fault entirely. For the white kitten had been having its face washed by the old cat for the last quarter of an hour (and bearing it pretty well, considering); so you see that it couldnt have had any hand in the mischief.</p>\n<p style='font-size: 16px; text-align: left'>The way Dinah washed her childrens faces was this: first she held the poor thing down by its ear with one paw, and then with the other paw she rubbed its face all over, the wrong way, beginning at the nose: and just now, as I said, she was hard at work on the white kitten, which was lying quite still and trying to purr—no doubt feeling that it was all meant for its good.</p>\n<p style='font-size: 16px; text-align: left'>But the black kitten had been finished with earlier in the afternoon, and so, while Alice was sitting curled up in a corner of the great arm-chair, half talking to herself and half asleep, the kitten had been having a grand game of romps with the ball of worsted Alice had been trying to wind up, and had been rolling it up and down till it had all come undone again; and there it was, spread over the hearth-rug, all knots and tangles, with the kitten running after its own tail in the middle.</p>",
"block_padding_top": 40,
"block_padding_left": 40,
"block_padding_right": 40
}
},
{
"block": "footer",
"options": {
}
},
{
"block": "canspam",
"options": {
"block_background": "#ececec"
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@@ -0,0 +1,75 @@
{
"name": "Your favourite band tour dates",
"blocks": [
{
"block": "header",
"options": {
}
},
{
"block": "heading",
"options": {
"text": "The Best Show Ever Soon Near You",
"font_size": 30
}
},
{
"block": "text",
"options": {
"html": "<p style=\"text-align: center;\"><span style=\"font-size: 16px; font-family: arial,helvetica,sans-serif;\">We just started our world wide tour and e are really exited to meet you in one of the following tour dates. Find the nearest city and be sure to lock your seat in advance.</span></p>",
"block_padding_left": 30,
"block_padding_right": 30
}
},
{
"block": "cta",
"options": {
"background": "#C97B6F",
"text": "Get your free ticket"
}
},
{
"block": "image",
"options": {
"placeholder": "{placeholder_base_url}/tour/images/tour.jpg"
}
},
{
"block": "heading",
"options": {
"text": "Find your date",
"font_size": 24
}
},
{
"block": "text",
"options":
{
"font_family":"Helvetica, Arial, sans-serif",
"block_padding_top":"10",
"block_padding_bottom":"20",
"block_padding_left":"30",
"block_padding_right":"30",
"html": "<ul>\n<li>23rd May, San Francisco</li>\n<li>1st June, London</li>\n<li>16th June, Rome</li>\n<li>1st July, Санкт-Петербург (Sankt-Peterburg)</li>\n<li>14th July, नई दिल्ली (New Delhi)</li>\n</ul>"
}
},
{
"block": "cta",
"options": {
"background": "#C97B6F",
"text": "Book now"
}
},
{
"block": "footer",
"options": {
}
},
{
"block": "canspam",
"options": {
"block_background": "#ececec"
}
}
]
}

View File

@@ -0,0 +1,63 @@
<script>
function tnp_suggest_subject() {
jQuery("#tnp-edit-subjects").show();
}
function tnp_emoji() {
jQuery("#tnp-edit-emoji").show();
}
jQuery(function () {
jQuery("#tnp-edit-subjects-list a").click(function (e) {
e.preventDefault();
jQuery("#options-subject").val(this.innerText);
jQuery("#options-title").val(this.innerText);
jQuery("#tnp-edit-subjects").hide();
});
jQuery("#tnp-edit-emoji-list a").click(function (e) {
e.preventDefault();
document.getElementById("options-subject").value = this.title + document.getElementById("options-subject").value;
jQuery("#tnp-edit-emoji").hide();
});
jQuery(".tnp-popup-close").click(function () {
$(this).parent().parent().hide();
});
});
</script>
<div id="tnp-edit-subjects" class="tnp-popup-overlay">
<div class="tnp-popup">
<a class="tnp-popup-close">&times;</a>
<p class="tnp-subjects-header">
Here are some subject examples you can start from to further engage your subscribers.
</p>
<div id="tnp-edit-subjects-list">
<h3 class="tnp-subject-category"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 48 48" xml:space="preserve" width="18" height="18"><g class="nc-icon-wrapper"><path fill="#43A6DD" d="M10,5C9.668,5,9.358,5.165,9.172,5.439C8.986,5.714,8.948,6.063,9.071,6.371 c0.078,0.194,7.669,19.475,0.222,26.922c-0.286,0.286-0.372,0.716-0.217,1.09C9.23,34.757,9.596,35,10,35h28c0.553,0,1-0.447,1-1 C39,18.01,25.99,5,10,5z"></path> <path fill="#BADEFC" d="M46,43c0.552,0,1-0.448,1-1V30.544c-0.646,0.29-1.257,0.684-1.787,1.214c-2.343,2.343-6.142,2.343-8.485,0 c-2.343-2.343-6.142-2.343-8.485,0c-2.343,2.343-6.142,2.343-8.485,0s-6.142-2.343-8.485,0s-6.142,2.343-8.485,0 c-0.53-0.53-1.141-0.924-1.787-1.214V42c0,0.552,0.448,1,1,1H46z"></path></g></svg>Dangers</h3>
<a href="#"><?php _e('How safe is your <em>[something]</em> from <em>[danger]</em>?', 'newsletter') ?></a><br>
<a href="#"><?php _e('10 Warning Signs That <em>[something]</em>', 'newsletter') ?></a><br>
<a href="#"><?php _e('10 Lies <em>[kind of people]</em> Likes to Tell', 'newsletter') ?></a><br>
<h3 class="tnp-subject-category"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 48 48" xml:space="preserve" width="18" height="18"><g class="nc-icon-wrapper"><path fill="#7C5839" d="M38.75586,31.34473C38.56543,31.12598,38.29004,31,38,31H10c-0.29004,0-0.56543,0.12598-0.75586,0.34473 c-0.18945,0.21924-0.27539,0.50977-0.23438,0.79688l2,14C11.08008,46.63428,11.50195,47,12,47h24 c0.49805,0,0.91992-0.36572,0.99023-0.8584l2-14C39.03125,31.85449,38.94531,31.56396,38.75586,31.34473z"></path> <path fill="#72C472" d="M34,6c-3.96655,0-7.38348,2.31537-9,5.66302V2c0-0.55225-0.44727-1-1-1s-1,0.44775-1,1v26 c0,0.55225,0.44727,1,1,1s1-0.44775,1-1v-8h1c5.52283,0,10-4.47717,10-10V6H34z"></path> <path fill="#A67C52" d="M42,33H6c-0.55273,0-1-0.44775-1-1v-4c0-0.55225,0.44727-1,1-1h36c0.55273,0,1,0.44775,1,1v4 C43,32.55225,42.55273,33,42,33z"></path></g></svg>Better life, problem management</h3>
<a href="#"><?php _e('10 Ways to Simplify Your <em>[something]</em>', 'newsletter') ?></a><br>
<a href="#"><?php _e('Get Rid of <em>[problem]</em> Once and Forever', 'newsletter') ?></a><br>
<a href="#"><?php _e('How to End [problem]', 'newsletter') ?></a><br>
<a href="#"><?php _e('Secrets of [famous people]', 'newsletter') ?></a><br>
<h3 class="tnp-subject-category"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 48 48" xml:space="preserve" width="18" height="18"><g class="nc-icon-wrapper"><path fill="#444444" d="M8,27H2c-0.553,0-1-0.447-1-1s0.447-1,1-1h6c0.553,0,1,0.447,1,1S8.553,27,8,27z"></path> <path fill="#444444" d="M12.185,15.19c-0.256,0-0.513-0.098-0.708-0.293l-4.185-4.19c-0.39-0.392-0.39-1.024,0.001-1.415 c0.391-0.389,1.024-0.39,1.415,0.001l4.185,4.19c0.39,0.392,0.39,1.024-0.001,1.415C12.696,15.093,12.44,15.19,12.185,15.19z"></path> <path fill="#444444" d="M35.815,15.19c-0.256,0-0.512-0.098-0.707-0.292c-0.391-0.391-0.391-1.023-0.001-1.415l4.185-4.19 c0.391-0.391,1.024-0.39,1.415-0.001c0.391,0.391,0.391,1.023,0.001,1.415l-4.185,4.19C36.328,15.093,36.071,15.19,35.815,15.19z"></path> <path fill="#444444" d="M8,45c-0.256,0-0.513-0.098-0.708-0.293c-0.39-0.392-0.39-1.024,0.001-1.415l4.189-4.184 c0.391-0.389,1.024-0.39,1.415,0.001c0.39,0.392,0.39,1.024-0.001,1.415l-4.189,4.184C8.512,44.902,8.256,45,8,45z"></path> <path fill="#444444" d="M40,45c-0.256,0-0.512-0.098-0.707-0.292l-4.189-4.184c-0.391-0.391-0.391-1.023-0.001-1.415 c0.391-0.391,1.024-0.39,1.415-0.001l4.189,4.184c0.391,0.391,0.391,1.023,0.001,1.415C40.513,44.902,40.256,45,40,45z"></path> <path fill="#444444" d="M46,27h-6c-0.553,0-1-0.447-1-1s0.447-1,1-1h6c0.553,0,1,0.447,1,1S46.553,27,46,27z"></path> <path fill="#E86C60" d="M32.324,9.555c-0.164-0.108-0.355-0.166-0.552-0.166c-0.001,0-0.001,0-0.002,0L16.188,9.413 c-0.196,0-0.389,0.059-0.552,0.167C10.31,13.125,7,19.799,7,27c0,11.028,7.626,20,17,20s17-8.972,17-20 C41,19.777,37.676,13.093,32.324,9.555z"></path> <path fill="#444444" d="M34.707,1.293c-0.391-0.391-1.023-0.391-1.414,0l-3.694,3.694C28.051,3.744,26.1,3,24,3 s-4.051,0.744-5.599,1.987l-3.694-3.694c-0.391-0.391-1.023-0.391-1.414,0s-0.391,1.023,0,1.414l3.689,3.689 c-0.993,1.243-1.669,2.757-1.891,4.426c-0.021,0.156-0.004,0.316,0.049,0.466C15.425,12.096,20.198,15,24,15s8.575-2.904,8.86-3.712 c0.053-0.149,0.069-0.31,0.049-0.466c-0.223-1.669-0.898-3.183-1.891-4.426l3.689-3.689C35.098,2.316,35.098,1.684,34.707,1.293z"></path> <path fill="#444444" d="M24,47c0.338,0,0.667-0.037,1-0.06V14c0-0.553-0.447-1-1-1s-1,0.447-1,1v32.94 C23.333,46.963,23.662,47,24,47z"></path> <circle fill="#444444" cx="15" cy="23" r="3"></circle> <circle fill="#444444" cx="17.5" cy="34.5" r="2.5"></circle> <circle fill="#444444" cx="33" cy="23" r="3"></circle> <circle fill="#444444" cx="30.5" cy="34.5" r="2.5"></circle></g></svg>Mistakes</h3>
<a href="#"><?php _e('Do You Make These 10 <em>[something]</em> Mistakes?', 'newsletter') ?></a><br>
<a href="#"><?php _e('10 <em>[something]</em> Mistakes That Make You Look Dumb', 'newsletter') ?></a><br>
<a href="#"><?php _e('Don\'t do These 10 Things When <em>[something]</em>', 'newsletter') ?></a><br>
<h3 class="tnp-subject-category"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 48 48" xml:space="preserve" width="18" height="18"><g class="nc-icon-wrapper"><path fill="#5A7A84" d="M6,13c2.75684,0,5-2.24316,5-5S8.75684,3,6,3S1,5.24316,1,8S3.24316,13,6,13z"></path> <path fill="#5A7A84" d="M6,19c-2.75684,0-5,2.24316-5,5s2.24316,5,5,5s5-2.24316,5-5S8.75684,19,6,19z"></path> <path fill="#5A7A84" d="M6,35c-2.75684,0-5,2.24316-5,5s2.24316,5,5,5s5-2.24316,5-5S8.75684,35,6,35z"></path> <path fill="#76B5B5" d="M46,10H16c-0.55229,0-1-0.44771-1-1V7c0-0.55228,0.44771-1,1-1h30c0.55228,0,1,0.44772,1,1v2 C47,9.55229,46.55228,10,46,10z"></path> <path fill="#76B5B5" d="M34,26H16c-0.55229,0-1-0.44772-1-1v-2c0-0.55228,0.44771-1,1-1h18c0.55228,0,1,0.44772,1,1v2 C35,25.55228,34.55228,26,34,26z"></path> <path fill="#76B5B5" d="M46,42H16c-0.55229,0-1-0.44772-1-1v-2c0-0.55228,0.44771-1,1-1h30c0.55228,0,1,0.44772,1,1v2 C47,41.55228,46.55228,42,46,42z"></path></g></svg>Lists (classic)</h3>
<a href="#"><?php _e('10 Ways to <em>[something]</em>', 'newsletter') ?></a><br>
<a href="#"><?php _e('The Top 10 <em>[something]</em>', 'newsletter') ?></a><br>
<a href="#"><?php _e('The 10 Rules for <em>[something]</em>', 'newsletter') ?></a><br>
<a href="#"><?php _e('Get/Become <em>[something]</em>. 10 Ideas That Work', 'newsletter') ?></a><br>
</div>
</div>
</div>

View File

@@ -0,0 +1,107 @@
<?php
if (!defined('ABSPATH'))
exit;
require_once NEWSLETTER_INCLUDES_DIR . '/controls.php';
$controls = new NewsletterControls();
$module = NewsletterEmails::instance();
if ($controls->is_action('theme')) {
$controls->merge($module->themes->get_options($controls->data['theme']));
$module->save_options($controls->data);
}
if ($controls->data == null) {
$controls->data = $module->get_options();
}
function newsletter_emails_update_options($options) {
add_option('newsletter_emails', '', null, 'no');
update_option('newsletter_emails', $options);
}
function newsletter_emails_update_theme_options($theme, $options) {
$x = strrpos($theme, '/');
if ($x !== false) {
$theme = substr($theme, $x + 1);
}
add_option('newsletter_emails_' . $theme, '', null, 'no');
update_option('newsletter_emails_' . $theme, $options);
}
function newsletter_emails_get_options() {
$options = get_option('newsletter_emails', array());
return $options;
}
function newsletter_emails_get_theme_options($theme) {
$x = strrpos($theme, '/');
if ($x !== false) {
$theme = substr($theme, $x + 1);
}
$options = get_option('newsletter_emails_' . $theme, array());
return $options;
}
$themes = $module->themes->get_all_with_data();
?>
<div class="wrap tnp-emails tnp-emails-theme" id="tnp-wrap">
<?php include NEWSLETTER_DIR . '/tnp-header.php'; ?>
<div id="tnp-heading">
<h2><?php _e('Select a theme', 'newsletter') ?>
<a class="tnp-btn-h1" href="https://www.thenewsletterplugin.com/plugins/newsletter/newsletter-themes" target="_blank">Custom themes</a>
</h2>
</div>
<div id="tnp-body" class="tnp-darkbg">
<form method="post" id="newsletter-form" action="<?php echo $module->get_admin_page_url('new'); ?>">
<?php $controls->init(); ?>
<?php $controls->hidden('theme'); ?>
<div class="tnp-themes-new">
<div class="tnp-theme-preview">
<p><?php echo _e('Responsive Drag & Drop Composer', 'newsletter') ?></p>
<a href="<?php echo $module->get_admin_page_url('composer'); ?>" style="margin-right: 20px; margin-bottom: 20px">
<img src="<?php echo plugins_url('newsletter') . '/emails/images/composer.gif' ?>" width="420" height="200">
</a>
</div>
<div class="tnp-theme-preview">
<p>&lt;&gt; Raw HTML</p>
<a href="#" onclick="var f = document.getElementById('newsletter-form');
f.act.value = 'theme';
f.elements['options[theme]'].value = 'rawhtml';
f.submit();
return false;" style="margin-right: 20px; margin-bottom: 20px">
<img src="<?php echo plugins_url('newsletter') . '/emails/images/html.png' ?>" width="200" height="200">
</a>
</div>
</div>
<?php foreach ($themes as $key => $data) { ?>
<div class="tnp-theme-preview">
<p><?php echo esc_html($data['name']) ?></p>
<a href="#" onclick="var f = document.getElementById('newsletter-form');
f.act.value = 'theme';
f.elements['options[theme]'].value = '<?php echo esc_js($data['id']) ?>';
f.submit();
return false;" style="margin-right: 20px; margin-bottom: 20px">
<img src="<?php echo esc_attr($data['screenshot']) ?>" width="200" height="200">
</a>
</div>
<?php } ?>
</form>
</div>
<?php include NEWSLETTER_DIR . '/tnp-footer.php'; ?>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -0,0 +1,9 @@
<?php
if (!defined('ABSPATH')) exit;
?>
<table class="form-table">
<tr>
<th><?php _e('Disable social links', 'newsletter') ?></th>
<td><?php $controls->checkbox('theme_social_disable', ''); ?></td>
</tr>
</table>

View File

@@ -0,0 +1,11 @@
<?php
if (!defined('ABSPATH')) exit;
?>
This email requires a modern e-mail reader but you can view the email online here:
{email_url}.
Thank you, <?php echo wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); ?>
To change your subscription follow:
{profile_url}.

View File

@@ -0,0 +1,45 @@
<?php
if (!defined('ABSPATH')) exit;
?><html>
<head>
<style>
body {
font-family: sans-serif;
font-size: 12px;
background-color: #ffffff;
}
</style>
</head>
<body bgcolor="#ffffff">
<h1>Your awesome title</h1>
<p>
Hi {name} (but you should remove that if you're not collecting subscriber names),
</p>
<p>
here the foreword of your shiny new newsletter. Most of the times a simple layout is the best.
</p>
<h2>There is more for you!</h2>
<p>Still not secure to sign up for our premium service? Even with a standard service plan you'll receive our t-shirt!</p>
<p>
Goodbye!
</p>
<?php include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social_main.php'; ?>
<hr>
<p>
To cancel <a href="{unsubscription_url}">click here</a>, to edit your subscription
<a href="{profile_url}">click here</a>.
</p>
<p>
<?php echo $theme_options['main_footer_contact'] ?>
</p>
<p>
<?php echo $theme_options['main_footer_legal'] ?>
</p>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Some files were not shown because too many files have changed in this diff Show More