Remove old settings files
[MAILPOET-2682]
This commit is contained in:
committed by
Veljko V
parent
a37732cfb1
commit
c19902c32d
@@ -1,87 +0,0 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { partial } from 'underscore';
|
||||
import MailPoet from 'mailpoet';
|
||||
import SenderEmailAddressWarning from 'common/sender_email_address_warning.jsx';
|
||||
|
||||
class DefaultSender extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
senderAddress: props.senderAddress,
|
||||
senderName: props.senderName,
|
||||
replyToName: props.replyToName,
|
||||
replyToAddress: props.replyToAddress,
|
||||
};
|
||||
this.onChange = this.onChange.bind(this);
|
||||
}
|
||||
|
||||
onChange(field, e) {
|
||||
const newState = {};
|
||||
newState[field] = e.target.value;
|
||||
this.setState(newState);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
<p>
|
||||
<label htmlFor="settings[from_name]">{MailPoet.I18n.t('from')}</label>
|
||||
<input
|
||||
type="text"
|
||||
id="settings[from_name]"
|
||||
data-automation-id="settings-page-from-name-field"
|
||||
name="sender[name]"
|
||||
value={this.state.senderName}
|
||||
onChange={partial(this.onChange, 'senderName')}
|
||||
placeholder={MailPoet.I18n.t('yourName')}
|
||||
/>
|
||||
<input
|
||||
type="email"
|
||||
id="settings[from_email]"
|
||||
name="sender[address]"
|
||||
data-automation-id="settings-page-from-email-field"
|
||||
value={this.state.senderAddress}
|
||||
onChange={partial(this.onChange, 'senderAddress')}
|
||||
placeholder="from@mydomain.com"
|
||||
/>
|
||||
</p>
|
||||
<div className="regular-text">
|
||||
<SenderEmailAddressWarning
|
||||
emailAddress={this.state.senderAddress}
|
||||
mssActive={this.props.mssActive}
|
||||
/>
|
||||
</div>
|
||||
<p>
|
||||
<label htmlFor="settings[reply_name]">{MailPoet.I18n.t('replyTo')}</label>
|
||||
<input
|
||||
type="text"
|
||||
id="settings[reply_name]"
|
||||
name="reply_to[name]"
|
||||
value={this.state.replyToName}
|
||||
onChange={partial(this.onChange, 'replyToName')}
|
||||
placeholder={MailPoet.I18n.t('yourName')}
|
||||
/>
|
||||
<input
|
||||
type="email"
|
||||
id="settings[reply_email]"
|
||||
name="reply_to[address]"
|
||||
value={this.state.replyToAddress}
|
||||
onChange={partial(this.onChange, 'replyToAddress')}
|
||||
placeholder="reply_to@mydomain.com"
|
||||
/>
|
||||
</p>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
DefaultSender.propTypes = {
|
||||
senderAddress: PropTypes.string.isRequired,
|
||||
senderName: PropTypes.string.isRequired,
|
||||
replyToAddress: PropTypes.string.isRequired,
|
||||
replyToName: PropTypes.string.isRequired,
|
||||
mssActive: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
export default DefaultSender;
|
@@ -1,37 +0,0 @@
|
||||
import MailPoet from 'mailpoet';
|
||||
|
||||
var element;
|
||||
function eventHandler() {
|
||||
if (confirm(MailPoet.I18n.t('reinstallConfirmation'))) { // eslint-disable-line
|
||||
MailPoet.trackEvent(
|
||||
'User has reinstalled MailPoet via Settings',
|
||||
{ 'MailPoet Free version': window.mailpoet_version }
|
||||
);
|
||||
|
||||
MailPoet.Modal.loading(true);
|
||||
MailPoet.Ajax.post({
|
||||
api_version: window.mailpoet_api_version,
|
||||
endpoint: 'setup',
|
||||
action: 'reset',
|
||||
}).always(function alwaysCb() {
|
||||
MailPoet.Modal.loading(false);
|
||||
}).done(function doneCb() {
|
||||
window.location = 'admin.php?page=mailpoet-newsletters';
|
||||
}).fail(function failCb(response) {
|
||||
if (response.errors.length > 0) {
|
||||
MailPoet.Notice.error(
|
||||
response.errors.map(function responseMapCb(error) {
|
||||
return error.message;
|
||||
}),
|
||||
{ scroll: true }
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
element = document.getElementById('mailpoet_reinstall');
|
||||
if (element) {
|
||||
element.addEventListener('click', eventHandler, false);
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import DefaultSender from 'old_settings/default_sender.jsx';
|
||||
import { GlobalContext, useGlobalContextValue } from 'context/index.jsx';
|
||||
import Notices from 'notices/notices.jsx';
|
||||
|
||||
const App = () => (
|
||||
<GlobalContext.Provider value={useGlobalContextValue(window)}>
|
||||
<Notices />
|
||||
<DefaultSender
|
||||
senderAddress={window.mailpoet_settings_sender_adddress}
|
||||
senderName={window.mailpoet_settings_sender_name}
|
||||
replyToAddress={window.mailpoet_settings_reply_to_address}
|
||||
replyToName={window.mailpoet_settings_reply_to_name}
|
||||
mssActive={window.mailpoet_mss_active}
|
||||
/>
|
||||
</GlobalContext.Provider>
|
||||
);
|
||||
|
||||
const settingsSenderContainer = document.getElementById('settings_sender_container');
|
||||
|
||||
if (settingsSenderContainer) {
|
||||
ReactDOM.render(<App />, settingsSenderContainer);
|
||||
}
|
@@ -1,96 +0,0 @@
|
||||
import Backbone from 'backbone';
|
||||
import jQuery from 'jquery';
|
||||
import mp from 'mailpoet';
|
||||
|
||||
var MailPoet = mp;
|
||||
if (jQuery('#mailpoet_settings').length > 0) {
|
||||
MailPoet.Router = new (Backbone.Router.extend({
|
||||
routes: {
|
||||
'': 'defaultRoute',
|
||||
'mta(/:group)': 'sendingMethodGroup',
|
||||
'(:tab)': 'tabs',
|
||||
},
|
||||
defaultRoute: function defaultRoute() {
|
||||
// redirect to new settings by default
|
||||
window.location.href = '?page=mailpoet-new-settings#/basics';
|
||||
},
|
||||
sendingMethodGroup: function sendingMethodGroup(group) {
|
||||
window.location.href = '?page=mailpoet-new-settings#/mta/' + (group || '');
|
||||
},
|
||||
tabs: function tabs(tab) {
|
||||
if (tab === 'basics') {
|
||||
window.location.href = '?page=mailpoet-new-settings#/basics';
|
||||
}
|
||||
if (tab === 'woocommerce') {
|
||||
if (!window.mailpoet_woocommerce_active) {
|
||||
window.location.href = '?page=mailpoet-new-settings#/basics';
|
||||
} else {
|
||||
window.location.href = '?page=mailpoet-new-settings#/woocommerce';
|
||||
}
|
||||
}
|
||||
if (tab === 'premium') {
|
||||
window.location.href = '?page=mailpoet-new-settings#/premium';
|
||||
}
|
||||
if (tab === 'signup') {
|
||||
window.location.href = '?page=mailpoet-new-settings#/signup';
|
||||
}
|
||||
if (tab === 'advanced') {
|
||||
window.location.href = '?page=mailpoet-new-settings#/advanced';
|
||||
}
|
||||
// reset all active tabs
|
||||
jQuery('.nav-tab-wrapper a').removeClass('nav-tab-active');
|
||||
|
||||
// hide panels & sections
|
||||
jQuery('.mailpoet_tab_panel, .mailpoet_section').hide();
|
||||
|
||||
// set active tab
|
||||
jQuery('a.nav-tab[href="#' + tab + '"]').addClass('nav-tab-active').blur();
|
||||
|
||||
// show selected panel
|
||||
if (jQuery('.mailpoet_tab_panel[data-tab="' + tab + '"]').length > 0) {
|
||||
jQuery('.mailpoet_tab_panel[data-tab="' + tab + '"]').show();
|
||||
}
|
||||
|
||||
// show "save settings" button
|
||||
if (tab !== 'premium') {
|
||||
jQuery('.mailpoet_settings_submit').show();
|
||||
}
|
||||
|
||||
// add 'nav-tab-reload' to all tabs when on '#premium'
|
||||
if (tab === 'premium') {
|
||||
jQuery('.nav-tab-wrapper .nav-tab').addClass('nav-tab-reload');
|
||||
}
|
||||
|
||||
MailPoet.trackEvent(
|
||||
'User has clicked a tab in Settings',
|
||||
{
|
||||
'MailPoet Free version': window.mailpoet_version,
|
||||
'Tab ID': tab,
|
||||
}
|
||||
);
|
||||
},
|
||||
}))();
|
||||
|
||||
// force full reload when going from/to '#premium' page
|
||||
window.addEventListener('hashchange', function hashchange(e) {
|
||||
e.preventDefault();
|
||||
const oldHash = e.oldURL.split('#')[1] || null;
|
||||
const newHash = e.newURL.split('#')[1] || null;
|
||||
if (oldHash === 'premium' || newHash === 'premium') {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(document).ready(function ready() {
|
||||
if (!Backbone.History.started) Backbone.history.start();
|
||||
|
||||
// force full tab reload for tabs with 'nav-tab-reload' class
|
||||
jQuery('.nav-tab').click(function click(e) {
|
||||
if (e.target.classList.contains('nav-tab-reload')) {
|
||||
e.preventDefault();
|
||||
window.history.replaceState(null, null, e.target.href);
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
@@ -8,11 +8,8 @@ import 'newsletters/automatic_emails.jsx'; // side effect - sets up automatic em
|
||||
import 'subscribers/subscribers.jsx'; // side effect - renders ReactDOM to document
|
||||
import 'newsletters/newsletters.jsx'; // side effect - renders ReactDOM to window
|
||||
import 'segments/segments.jsx'; // side effect - renders ReactDOM to document
|
||||
import 'old_settings/settings.jsx'; // side effect - renders ReactDOM to document
|
||||
import 'forms/forms.jsx'; // side effect - renders ReactDOM to document
|
||||
import 'old_settings/tabs.js'; // side effect - assigns to MailPoet.Router, executes code on doc ready
|
||||
import 'help/help.jsx'; // side effect - renders ReactDOM to document
|
||||
import 'old_settings/reinstall_from_scratch.js'; // side effect - adds event handler to document
|
||||
import 'subscribers/importExport/import.jsx'; // side effect - executes on doc ready, adds events
|
||||
import 'subscribers/importExport/export.js'; // side effect - executes on doc ready
|
||||
import 'wizard/wizard.jsx'; // side effect - renders ReactDOM to document
|
||||
|
@@ -1,104 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\AdminPages\Pages;
|
||||
|
||||
use MailPoet\AdminPages\PageRenderer;
|
||||
use MailPoet\Config\Installer;
|
||||
use MailPoet\Config\ServicesChecker;
|
||||
use MailPoet\Cron\CronTrigger;
|
||||
use MailPoet\Models\Segment;
|
||||
use MailPoet\Models\Subscriber;
|
||||
use MailPoet\Services\Bridge;
|
||||
use MailPoet\Settings\Hosts;
|
||||
use MailPoet\Settings\Pages;
|
||||
use MailPoet\Settings\SettingsController;
|
||||
use MailPoet\Subscription\Captcha;
|
||||
use MailPoet\Util\Installation;
|
||||
use MailPoet\Util\License\License;
|
||||
use MailPoet\WooCommerce\Helper as WooCommerceHelper;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
use MailPoet\WP\Notice as WPNotice;
|
||||
|
||||
class OldSettings {
|
||||
/** @var PageRenderer */
|
||||
private $pageRenderer;
|
||||
|
||||
/** @var SettingsController */
|
||||
private $settings;
|
||||
|
||||
/** @var WooCommerceHelper */
|
||||
private $woocommerceHelper;
|
||||
|
||||
/** @var WPFunctions */
|
||||
private $wp;
|
||||
|
||||
/** @var ServicesChecker */
|
||||
private $servicesChecker;
|
||||
|
||||
/** @var Captcha */
|
||||
private $captcha;
|
||||
|
||||
/** @var Installation */
|
||||
private $installation;
|
||||
|
||||
public function __construct(
|
||||
PageRenderer $pageRenderer,
|
||||
SettingsController $settings,
|
||||
WooCommerceHelper $woocommerceHelper,
|
||||
WPFunctions $wp,
|
||||
ServicesChecker $servicesChecker,
|
||||
Installation $installation,
|
||||
Captcha $captcha
|
||||
) {
|
||||
$this->pageRenderer = $pageRenderer;
|
||||
$this->settings = $settings;
|
||||
$this->woocommerceHelper = $woocommerceHelper;
|
||||
$this->wp = $wp;
|
||||
$this->servicesChecker = $servicesChecker;
|
||||
$this->installation = $installation;
|
||||
$this->captcha = $captcha;
|
||||
}
|
||||
|
||||
public function render() {
|
||||
$settings = $this->settings->getAll();
|
||||
|
||||
$premiumKeyValid = $this->servicesChecker->isPremiumKeyValid(false);
|
||||
// force MSS key check even if the method isn't active
|
||||
$mpApiKeyValid = $this->servicesChecker->isMailPoetAPIKeyValid(false, true);
|
||||
|
||||
$data = [
|
||||
'settings' => $settings,
|
||||
'segments' => Segment::getSegmentsWithSubscriberCount(),
|
||||
'cron_trigger' => CronTrigger::METHODS,
|
||||
'total_subscribers' => Subscriber::getTotalSubscribers(),
|
||||
'premium_plugin_active' => License::getLicense(),
|
||||
'premium_key_valid' => !empty($premiumKeyValid),
|
||||
'mss_active' => Bridge::isMPSendingServiceEnabled(),
|
||||
'mss_key_valid' => !empty($mpApiKeyValid),
|
||||
'members_plugin_active' => $this->wp->isPluginActive('members/members.php'),
|
||||
'pages' => Pages::getAll(),
|
||||
'current_user' => $this->wp->wpGetCurrentUser(),
|
||||
'linux_cron_path' => dirname(dirname(dirname(__DIR__))),
|
||||
'is_woocommerce_active' => $this->woocommerceHelper->isWooCommerceActive(),
|
||||
'ABSPATH' => ABSPATH,
|
||||
'hosts' => [
|
||||
'web' => Hosts::getWebHosts(),
|
||||
'smtp' => Hosts::getSMTPHosts(),
|
||||
],
|
||||
'built_in_captcha_supported' => $this->captcha->isSupported(),
|
||||
];
|
||||
|
||||
$data['is_new_user'] = $this->installation->isNewInstallation();
|
||||
|
||||
$data = array_merge($data, Installer::getPremiumStatus());
|
||||
|
||||
if (isset($_GET['enable-customizer-notice'])) {
|
||||
$notice = new WPNotice(WPNotice::TYPE_ERROR, $this->wp->_x(
|
||||
'You need to have WooCommerce active to access the MailPoet email customizer for WooCommerce.',
|
||||
'Notice in Settings when WooCommerce is not enabled'
|
||||
), 'mailpoet');
|
||||
$notice->displayWPNotice();
|
||||
}
|
||||
$this->pageRenderer->displayPage('old_settings.html', $data);
|
||||
}
|
||||
}
|
@@ -9,7 +9,6 @@ use MailPoet\AdminPages\Pages\Help;
|
||||
use MailPoet\AdminPages\Pages\MP2Migration;
|
||||
use MailPoet\AdminPages\Pages\NewsletterEditor;
|
||||
use MailPoet\AdminPages\Pages\Newsletters;
|
||||
use MailPoet\AdminPages\Pages\OldSettings;
|
||||
use MailPoet\AdminPages\Pages\Premium;
|
||||
use MailPoet\AdminPages\Pages\RevenueTrackingPermission;
|
||||
use MailPoet\AdminPages\Pages\Segments;
|
||||
@@ -275,7 +274,7 @@ class Menu {
|
||||
'mailpoet-settings',
|
||||
[
|
||||
$this,
|
||||
'oldSettings',
|
||||
'settings',
|
||||
]
|
||||
);
|
||||
|
||||
@@ -371,7 +370,7 @@ class Menu {
|
||||
]
|
||||
);
|
||||
|
||||
// Settings page
|
||||
// Experimental page
|
||||
$this->wp->addSubmenuPage(
|
||||
true,
|
||||
$this->setPageTitle('Experimental Features'),
|
||||
@@ -380,16 +379,6 @@ class Menu {
|
||||
'mailpoet-experimental',
|
||||
[$this, 'experimentalFeatures']
|
||||
);
|
||||
|
||||
// New Settings page
|
||||
$this->wp->addSubmenuPage(
|
||||
self::MAIN_PAGE_SLUG,
|
||||
$this->setPageTitle(__('Settings', 'mailpoet')),
|
||||
'',
|
||||
AccessControl::PERMISSION_MANAGE_SETTINGS,
|
||||
'mailpoet-new-settings',
|
||||
[$this, 'settings']
|
||||
);
|
||||
}
|
||||
|
||||
public function disableWPEmojis() {
|
||||
@@ -421,10 +410,6 @@ class Menu {
|
||||
$this->container->get(Premium::class)->render();
|
||||
}
|
||||
|
||||
public function oldSettings() {
|
||||
$this->container->get(OldSettings::class)->render();
|
||||
}
|
||||
|
||||
public function settings() {
|
||||
$this->container->get(Settings::class)->render();
|
||||
}
|
||||
|
@@ -44,7 +44,6 @@ class ContainerConfigurator implements IContainerConfigurator {
|
||||
$container->autowire(\MailPoet\AdminPages\Pages\Premium::class)->setPublic(true);
|
||||
$container->autowire(\MailPoet\AdminPages\Pages\RevenueTrackingPermission::class)->setPublic(true);
|
||||
$container->autowire(\MailPoet\AdminPages\Pages\Segments::class)->setPublic(true);
|
||||
$container->autowire(\MailPoet\AdminPages\Pages\OldSettings::class)->setPublic(true);
|
||||
$container->autowire(\MailPoet\AdminPages\Pages\Settings::class)->setPublic(true);
|
||||
$container->autowire(\MailPoet\AdminPages\Pages\Subscribers::class)->setPublic(true);
|
||||
$container->autowire(\MailPoet\AdminPages\Pages\SubscribersExport::class)->setPublic(true);
|
||||
|
@@ -23,8 +23,7 @@ class MailpoetMenuCest {
|
||||
$i->seeInCurrentUrl('?page=mailpoet-segments');
|
||||
|
||||
$i->click('Settings');
|
||||
// this is temporary while implementing the new settings
|
||||
$i->seeInCurrentUrl('?page=mailpoet-new-settings');
|
||||
$i->seeInCurrentUrl('?page=mailpoet-settings');
|
||||
|
||||
$i->click('Help');
|
||||
$i->seeInCurrentUrl('?page=mailpoet-help');
|
||||
|
@@ -1,249 +0,0 @@
|
||||
<% extends 'layout.html' %>
|
||||
|
||||
<% block content %>
|
||||
<div id="mailpoet_settings">
|
||||
|
||||
<h1 class="title"><%= __('Settings') %></h1>
|
||||
|
||||
<!-- settings form -->
|
||||
<form
|
||||
id="mailpoet_settings_form"
|
||||
name="mailpoet_settings_form"
|
||||
class="mailpoet_form"
|
||||
autocomplete="off"
|
||||
novalidate
|
||||
>
|
||||
<!-- tabs -->
|
||||
<h2 class="nav-tab-wrapper" id="mailpoet_settings_tabs">
|
||||
<a class="nav-tab" href="?page=mailpoet-new-settings#/basics" data-automation-id="basic_settings_tab"><%= __('Basics') %></a>
|
||||
<a class="nav-tab" href="?page=mailpoet-new-settings#signup" data-automation-id="signup_settings_tab"><%= __('Sign-up Confirmation') %></a>
|
||||
<a class="nav-tab" href="#mta" data-automation-id="send_with_settings_tab"><%= __('Send With...') %></a>
|
||||
<% if is_woocommerce_active %>
|
||||
<a class="nav-tab" href="?page=mailpoet-new-settings#/woocommerce" data-automation-id="woocommerce_settings_tab"><%= __('WooCommerce') %></a>
|
||||
<% endif %>
|
||||
<a class="nav-tab" href="?page=mailpoet-new-settings#/advanced" data-automation-id="settings-advanced-tab"><%= __('Advanced') %></a>
|
||||
<a class="nav-tab nav-tab-reload" href="?page=mailpoet-new-settings#premium" data-automation-id="activation_settings_tab"><%= __('Key Activation') %></a>
|
||||
</h2>
|
||||
|
||||
<!-- sending method -->
|
||||
<div data-tab="mta" class="mailpoet_tab_panel">
|
||||
<% include 'settings/mta.html' %>
|
||||
</div>
|
||||
|
||||
<p class="submit mailpoet_settings_submit" style="display:none;">
|
||||
<input
|
||||
type="submit"
|
||||
class="button button-primary"
|
||||
name="submit"
|
||||
data-automation-id="settings-submit-button"
|
||||
value="<%= __('Save settings') %>"
|
||||
/>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function($) {
|
||||
// on dom loaded
|
||||
$(function() {
|
||||
// on form submission
|
||||
$('#mailpoet_settings_form').on('submit', function() {
|
||||
var errorFound = false;
|
||||
// Check if filled emails are valid
|
||||
var invalidEmails = $.map($('#mailpoet_settings_form')[0].elements, function(el) {
|
||||
return el.type === 'email' && el.value && !window.mailpoet_email_regex.test(el.value) ? el.value : null;
|
||||
}).filter(function(val) { return !!val; });
|
||||
if (invalidEmails.length) {
|
||||
MailPoet.Notice.error(
|
||||
"<%= __('Invalid email addresses: ') | escape('js') %>" + invalidEmails.join(', '),
|
||||
{ scroll: true }
|
||||
);
|
||||
errorFound = true;
|
||||
}
|
||||
|
||||
// stop processing if an error was found
|
||||
if (errorFound) {
|
||||
return false;
|
||||
}
|
||||
// if we're setting up a sending method, try to activate it
|
||||
if ($('.mailpoet_mta_setup_save').is(':visible')) {
|
||||
$('.mailpoet_mta_setup_save').trigger('click');
|
||||
}
|
||||
saveSettings();
|
||||
return false;
|
||||
});
|
||||
|
||||
function saveSettings() {
|
||||
// serialize form data
|
||||
var settings_data = $('#mailpoet_settings_form').mailpoetSerializeObject();
|
||||
|
||||
// show loading screen
|
||||
MailPoet.Modal.loading(true);
|
||||
|
||||
MailPoet.Ajax.post({
|
||||
api_version: window.mailpoet_api_version,
|
||||
endpoint: 'settings',
|
||||
action: 'set',
|
||||
data: settings_data
|
||||
}).always(function() {
|
||||
MailPoet.Modal.loading(false);
|
||||
}).done(function(response) {
|
||||
MailPoet.Notice.success(
|
||||
"<%= __('Settings saved') | escape('js') %>",
|
||||
{ scroll: true }
|
||||
);
|
||||
MailPoet.trackEvent(
|
||||
'User has saved Settings',
|
||||
{
|
||||
'MailPoet Free version': window.mailpoet_version,
|
||||
'Sending method type': settings_data.mta_group || null,
|
||||
'Sending frequency (emails)': settings_data.mta_group != 'mailpoet' && settings_data.mta && settings_data.mta.frequency && settings_data.mta.frequency.emails,
|
||||
'Sending frequency (interval)': settings_data.mta_group != 'mailpoet' && settings_data.mta && settings_data.mta.frequency && settings_data.mta.frequency.interval,
|
||||
'Sending provider': settings_data.mta_group == 'smtp' && settings_data.smtp_provider,
|
||||
'Sign-up confirmation enabled': (settings_data.signup_confirmation && settings_data.signup_confirmation.enabled == true),
|
||||
'Bounce email is present': (settings_data.bounce && settings_data.bounce.address != ""),
|
||||
<% if is_woocommerce_active %>
|
||||
'WooCommerce email customizer enabled': (settings_data.woocommerce && settings_data.woocommerce.use_mailpoet_editor),
|
||||
<% endif %>
|
||||
'Newsletter task scheduler method': (settings_data.cron_trigger && settings_data.cron_trigger.method)
|
||||
}
|
||||
);
|
||||
}).fail(function(response) {
|
||||
if (response.errors.length > 0) {
|
||||
MailPoet.Notice.error(
|
||||
response.errors.map(function(error) { return error.message; }),
|
||||
{ scroll: true }
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// setup toggle checkboxes
|
||||
function toggleContent() {
|
||||
$('#'+$(this).data('toggle'))[
|
||||
($(this).is(':checked'))
|
||||
? 'show'
|
||||
: 'hide'
|
||||
]();
|
||||
}
|
||||
|
||||
$(document).on('click', 'input[data-toggle]', toggleContent);
|
||||
$('input[data-toggle]').each(toggleContent);
|
||||
|
||||
function toggleReCaptchaSettings() {
|
||||
if ($('input[name="captcha[type]"]:checked').val() == 'recaptcha') {
|
||||
$('#settings_recaptcha_tokens').show();
|
||||
} else {
|
||||
$('#settings_recaptcha_tokens').hide();
|
||||
}
|
||||
}
|
||||
$('input[name="captcha[type]"]').on('click', toggleReCaptchaSettings);
|
||||
toggleReCaptchaSettings();
|
||||
$('#settings_recaptcha_tokens_error').hide();
|
||||
|
||||
$('#settings_subscriber_email_notification_error').hide();
|
||||
$('#settings_stats_notifications_error').hide();
|
||||
|
||||
<% if is_woocommerce_active %>
|
||||
$('#settings_woocommerce_optin_on_checkout_error').hide();
|
||||
|
||||
$('.mailpoet_woocommerce_editor_button').on('click', function() {
|
||||
var emailId = "<%= settings.woocommerce.transactional_email_id %>";
|
||||
if (!emailId) {
|
||||
MailPoet.Ajax.post({
|
||||
api_version: window.mailpoet_api_version,
|
||||
endpoint: 'settings',
|
||||
action: 'set',
|
||||
data: {
|
||||
'woocommerce.use_mailpoet_editor': 1,
|
||||
},
|
||||
}).done(function (response) {
|
||||
emailId = response.data.woocommerce.transactional_email_id;
|
||||
window.location.href = '?page=mailpoet-newsletter-editor&id=' + emailId;
|
||||
}).fail(function (response) {
|
||||
MailPoet.Notice.showApiErrorNotice(response, { scroll: true });
|
||||
});
|
||||
} else {
|
||||
window.location.href = '?page=mailpoet-newsletter-editor&id=' + emailId;
|
||||
}
|
||||
});
|
||||
<% endif %>
|
||||
|
||||
function toggleLinuxCronSettings() {
|
||||
if ($('input[name="cron_trigger[method]"]:checked').val() === '<%= cron_trigger.linux_cron %>') {
|
||||
$('#settings_linux_cron').show();
|
||||
} else {
|
||||
$('#settings_linux_cron').hide();
|
||||
}
|
||||
}
|
||||
$('input[name="cron_trigger[method]"]').on('click', toggleLinuxCronSettings);
|
||||
toggleLinuxCronSettings();
|
||||
|
||||
// page preview
|
||||
$('.mailpoet_page_preview').on('click', function() {
|
||||
var selection = $(this).siblings('.mailpoet_page_selection');
|
||||
|
||||
if (selection.length > 0) {
|
||||
$(this).attr('href', $(selection).find('option[value="'+$(selection).val()+'"]').data('preview-url'));
|
||||
$(this).attr('target', '_blank');
|
||||
} else {
|
||||
$(this).attr('href', 'javascript:;');
|
||||
$(this).removeAttr('target');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
<% set newUser = (is_new_user == true) ? 'true' : 'false' %>
|
||||
<% autoescape 'js' %>
|
||||
var mailpoet_is_new_user = <%= newUser %>;
|
||||
var mailpoet_settings_sender_name = "<%= settings.sender.name %>";
|
||||
var mailpoet_settings_sender_adddress = "<%= settings.sender.address %>";
|
||||
var mailpoet_settings_reply_to_name = "<%= settings.reply_to.name %>";
|
||||
var mailpoet_settings_reply_to_address = "<%= settings.reply_to.address %>";
|
||||
var mailpoet_settings_signup_confirmation_name = "<%= settings.signup_confirmation.from.name %>";
|
||||
var mailpoet_settings_signup_confirmation_address = "<%= settings.signup_confirmation.from.address %>";
|
||||
var mailpoet_installed_at = '<%= settings.installed_at %>';
|
||||
var mailpoet_mss_active = <%= json_encode(settings.mta_group == 'mailpoet') %>;
|
||||
<% endautoescape %>
|
||||
var mailpoet_beacon_articles = [
|
||||
'57f71d49c697911f2d323486',
|
||||
'57fb0e1d9033600277a681ca',
|
||||
'57f49a929033602e61d4b9f4',
|
||||
'57fb134cc697911f2d323e3b',
|
||||
];
|
||||
</script>
|
||||
<% endblock %>
|
||||
<% block translations %>
|
||||
<%= localize({
|
||||
'reinstallConfirmation': __('Are you sure? All of your MailPoet data will be permanently erased (newsletters, statistics, subscribers, etc.).'),
|
||||
'announcementHeader': __('Get notified when someone subscribes'),
|
||||
'announcementParagraph1': __('It’s been a popular feature request from our users, we hope you get lots of emails about all your new subscribers!'),
|
||||
'announcementParagraph2': __('(You can turn this feature off if it’s too many emails.)'),
|
||||
'yourName': __('Your name'),
|
||||
'from': __('From'),
|
||||
'replyTo': __('Reply-to'),
|
||||
|
||||
'premiumTabActivationKeyLabel': __('Activation Key', 'mailpoet'),
|
||||
'premiumTabDescription': __('This key is used to validate your free or paid subscription. Paying customers will enjoy automatic upgrades of their Premium plugin and access to faster support.', 'mailpoet'),
|
||||
'premiumTabNoKeyNotice': __('Please specify a license key before validating it.', 'mailpoet'),
|
||||
'premiumTabVerifyButton': __('Verify', 'mailpoet'),
|
||||
'premiumTabKeyValidMessage': __('Your key is valid', 'mailpoet'),
|
||||
'premiumTabKeyNotValidMessage': __('Your key is not valid', 'mailpoet'),
|
||||
'premiumTabPremiumActiveMessage': __('MailPoet Premium is active', 'mailpoet'),
|
||||
'premiumTabPremiumInstallingMessage': __('MailPoet Premium plugin is being installed', 'mailpoet'),
|
||||
'premiumTabPremiumActivatingMessage': __('MailPoet Premium plugin is being activated', 'mailpoet'),
|
||||
'premiumTabPremiumNotInstalledMessage': __('MailPoet Premium is not installed.', 'mailpoet'),
|
||||
'premiumTabPremiumInstallMessage': __('Install MailPoet Premium plugin', 'mailpoet'),
|
||||
'premiumTabPremiumNotActiveMessage': __('MailPoet Premium is not active.', 'mailpoet'),
|
||||
'premiumTabPremiumActivateMessage': __('Activate MailPoet Premium plugin', 'mailpoet'),
|
||||
'premiumTabPremiumInstallationInstallingMessage': __('downloading MailPoet Premium…', 'mailpoet'),
|
||||
'premiumTabPremiumInstallationActivatingMessage': __('activating MailPoet Premium…', 'mailpoet'),
|
||||
'premiumTabPremiumInstallationActiveMessage': __('MailPoet Premium is active!', 'mailpoet'),
|
||||
'premiumTabPremiumInstallationErrorMessage': __('Something went wrong. Please [link]download the Premium plugin from your account[/link] and [link]contact our support team[/link].', 'mailpoet'),
|
||||
'premiumTabPremiumKeyNotValidMessage': __('Your key is not valid for MailPoet Premium', 'mailpoet'),
|
||||
'premiumTabMssActiveMessage': __('MailPoet Sending Service is active', 'mailpoet'),
|
||||
'premiumTabMssNotActiveMessage': __('MailPoet Sending Service is not active.', 'mailpoet'),
|
||||
'premiumTabMssActivateMessage': __('Activate MailPoet Sending Service', 'mailpoet'),
|
||||
'premiumTabMssKeyNotValidMessage': __('Your key is not valid for the MailPoet Sending Service', 'mailpoet'),
|
||||
}) %>
|
||||
<% endblock %>
|
File diff suppressed because it is too large
Load Diff
@@ -1,25 +0,0 @@
|
||||
{{#unless only_daily}}
|
||||
<!-- number of emails & frequency -->
|
||||
<%=
|
||||
__('%1$s emails')
|
||||
| format('{{ emails }}')
|
||||
%> {{ format_time interval }}.
|
||||
{{/unless}}
|
||||
|
||||
<!-- number of emails per day -->
|
||||
<%=
|
||||
__("That's <strong>%1$s emails</strong> per day")
|
||||
| format('{{ daily_emails }}')
|
||||
| raw
|
||||
%>
|
||||
|
||||
{{#ifCond emails_per_second ">" "1"}}
|
||||
<br /><br />
|
||||
<span style="color: #d54e21;">
|
||||
<%=
|
||||
__("That's %1$s emails per second. <strong>We highly recommend to send 1 email per second, at the absolute maximum.</strong> MailPoet needs at least one second to process and send a single email (on most hosts.) <strong>Alternatively, send with MailPoet, which can be up to 50 times faster.</strong>")
|
||||
| format('{{ emails_per_second }}')
|
||||
| raw
|
||||
%>
|
||||
</span>
|
||||
{{/ifCond}}
|
Reference in New Issue
Block a user