Add SubscribersLimitNotice to mailpoet-subscribers page
[MAILPOET-2626]
This commit is contained in:
committed by
Jack Kitterhing
parent
01b498f549
commit
f7a1f63a28
@@ -4,6 +4,7 @@ import MailPoet from 'mailpoet';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Form from 'form/form.jsx';
|
import Form from 'form/form.jsx';
|
||||||
import ReactStringReplace from 'react-string-replace';
|
import ReactStringReplace from 'react-string-replace';
|
||||||
|
import SubscribersLimitNotice from 'notices/subscribers_limit_notice.jsx';
|
||||||
|
|
||||||
const fields = [
|
const fields = [
|
||||||
{
|
{
|
||||||
@@ -184,6 +185,8 @@ class SubscriberForm extends React.Component { // eslint-disable-line react/pref
|
|||||||
<Link className="page-title-action" to="/">{MailPoet.I18n.t('backToList')}</Link>
|
<Link className="page-title-action" to="/">{MailPoet.I18n.t('backToList')}</Link>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
<SubscribersLimitNotice />
|
||||||
|
|
||||||
<Form
|
<Form
|
||||||
automationId="subscriber_edit_form"
|
automationId="subscriber_edit_form"
|
||||||
endpoint="subscribers"
|
endpoint="subscribers"
|
||||||
|
@@ -8,6 +8,7 @@ import PropTypes from 'prop-types';
|
|||||||
|
|
||||||
import Listing from 'listing/listing.jsx';
|
import Listing from 'listing/listing.jsx';
|
||||||
import Selection from 'form/fields/selection.jsx';
|
import Selection from 'form/fields/selection.jsx';
|
||||||
|
import SubscribersLimitNotice from 'notices/subscribers_limit_notice.jsx';
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
@@ -382,6 +383,8 @@ class SubscriberList extends React.Component {
|
|||||||
</a>
|
</a>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
<SubscribersLimitNotice />
|
||||||
|
|
||||||
<Listing
|
<Listing
|
||||||
limit={window.mailpoet_listing_per_page}
|
limit={window.mailpoet_listing_per_page}
|
||||||
location={this.props.location}
|
location={this.props.location}
|
||||||
|
@@ -7,8 +7,10 @@ use MailPoet\Form\Block;
|
|||||||
use MailPoet\Listing\PageLimit;
|
use MailPoet\Listing\PageLimit;
|
||||||
use MailPoet\Models\CustomField;
|
use MailPoet\Models\CustomField;
|
||||||
use MailPoet\Models\Segment;
|
use MailPoet\Models\Segment;
|
||||||
|
use MailPoet\Models\Subscriber;
|
||||||
use MailPoet\Services\Bridge;
|
use MailPoet\Services\Bridge;
|
||||||
use MailPoet\Subscribers\ConfirmationEmailMailer;
|
use MailPoet\Subscribers\ConfirmationEmailMailer;
|
||||||
|
use MailPoet\Util\License\Features\Subscribers as SubscribersFeature;
|
||||||
use MailPoet\Util\License\License;
|
use MailPoet\Util\License\License;
|
||||||
use MailPoet\WP\Functions as WPFunctions;
|
use MailPoet\WP\Functions as WPFunctions;
|
||||||
|
|
||||||
@@ -19,12 +21,16 @@ class Subscribers {
|
|||||||
/** @var PageLimit */
|
/** @var PageLimit */
|
||||||
private $listingPageLimit;
|
private $listingPageLimit;
|
||||||
|
|
||||||
|
/** @var SubscribersFeature */
|
||||||
|
private $subscribersFeature;
|
||||||
|
|
||||||
/** @var WPFunctions */
|
/** @var WPFunctions */
|
||||||
private $wp;
|
private $wp;
|
||||||
|
|
||||||
public function __construct(PageRenderer $pageRenderer, PageLimit $listingPageLimit, WPFunctions $wp) {
|
public function __construct(PageRenderer $pageRenderer, PageLimit $listingPageLimit, SubscribersFeature $subscribersFeature, WPFunctions $wp) {
|
||||||
$this->pageRenderer = $pageRenderer;
|
$this->pageRenderer = $pageRenderer;
|
||||||
$this->listingPageLimit = $listingPageLimit;
|
$this->listingPageLimit = $listingPageLimit;
|
||||||
|
$this->subscribersFeature = $subscribersFeature;
|
||||||
$this->wp = $wp;
|
$this->wp = $wp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,6 +67,11 @@ class Subscribers {
|
|||||||
|
|
||||||
$data['max_confirmation_emails'] = ConfirmationEmailMailer::MAX_CONFIRMATION_EMAILS;
|
$data['max_confirmation_emails'] = ConfirmationEmailMailer::MAX_CONFIRMATION_EMAILS;
|
||||||
|
|
||||||
|
$data['subscribers_limit'] = $this->subscribersFeature->getSubscribersLimit();
|
||||||
|
$data['subscribers_limit_reached'] = $this->subscribersFeature->check();
|
||||||
|
$data['has_valid_api_key'] = $this->subscribersFeature->hasValidApiKey();
|
||||||
|
$data['subscriber_count'] = Subscriber::getTotalSubscribers();
|
||||||
|
|
||||||
$this->pageRenderer->displayPage('subscribers/subscribers.html', $data);
|
$this->pageRenderer->displayPage('subscribers/subscribers.html', $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -83,6 +83,12 @@ jQuery('.toplevel_page_mailpoet-newsletters.menu-top-last')
|
|||||||
'spfCheckMsgEdit': _x("Since you're sending with the MailPoet Sending Service, you need to add %s to the existing SPF entry in your DNS records. This will allow MailPoet to send on your behalf for optimal deliverability.", 'DNS SPF Record check'),
|
'spfCheckMsgEdit': _x("Since you're sending with the MailPoet Sending Service, you need to add %s to the existing SPF entry in your DNS records. This will allow MailPoet to send on your behalf for optimal deliverability.", 'DNS SPF Record check'),
|
||||||
'spfCheckReadMore': _x('Read the Guide', 'DNS SPF Record check'),
|
'spfCheckReadMore': _x('Read the Guide', 'DNS SPF Record check'),
|
||||||
|
|
||||||
|
'subscribersLimitNoticeTitle': __('Congratulations, you now have more than [subscribersLimit] subscribers!'),
|
||||||
|
'freeVersionLimit': __('Our free version is limited to [subscribersLimit] subscribers.'),
|
||||||
|
'yourPlanLimit': __('Your plan is limited to [subscribersLimit] subscribers.'),
|
||||||
|
'youNeedToUpgrade': __('You need to upgrade now to be able to continue using MailPoet.'),
|
||||||
|
'upgradeNow': __('Upgrade Now'),
|
||||||
|
'refreshMySubscribers': __('I’ve upgraded my subscription, refresh subscriber limit'),
|
||||||
}) %>
|
}) %>
|
||||||
<% block translations %><% endblock %>
|
<% block translations %><% endblock %>
|
||||||
|
|
||||||
|
@@ -398,13 +398,6 @@
|
|||||||
|
|
||||||
'gaCampaignLine': __('Google Analytics Campaign'),
|
'gaCampaignLine': __('Google Analytics Campaign'),
|
||||||
'gaCampaignTip': __('For example, “Spring email”. [link]Read the guide.[/link]'),
|
'gaCampaignTip': __('For example, “Spring email”. [link]Read the guide.[/link]'),
|
||||||
|
|
||||||
'subscribersLimitNoticeTitle': __('Congratulations, you now have more than [subscribersLimit] subscribers!'),
|
|
||||||
'freeVersionLimit': __('Our free version is limited to [subscribersLimit] subscribers.'),
|
|
||||||
'yourPlanLimit': __('Your plan is limited to [subscribersLimit] subscribers.'),
|
|
||||||
'youNeedToUpgrade': __('You need to upgrade now to be able to continue using MailPoet.'),
|
|
||||||
'upgradeNow': __('Upgrade Now'),
|
|
||||||
'refreshMySubscribers': __('I’ve upgraded my subscription, refresh subscriber limit'),
|
|
||||||
}) %>
|
}) %>
|
||||||
<% include('mss_pitch_translations.html') %>
|
<% include('mss_pitch_translations.html') %>
|
||||||
<% endblock %>
|
<% endblock %>
|
||||||
|
@@ -19,6 +19,10 @@
|
|||||||
'5cbf19622c7d3a026fd3efe1',
|
'5cbf19622c7d3a026fd3efe1',
|
||||||
'58a5a7502c7d3a576d353c78',
|
'58a5a7502c7d3a576d353c78',
|
||||||
];
|
];
|
||||||
|
var mailpoet_subscribers_limit = <%= subscribers_limit ? subscribers_limit : 'false' %>;
|
||||||
|
var mailpoet_subscribers_limit_reached = <%= subscribers_limit_reached ? 'true' : 'false' %>;
|
||||||
|
var mailpoet_has_valid_api_key = <%= has_valid_api_key ? 'true' : 'false' %>;
|
||||||
|
var mailpoet_subscribers_count = <%= subscriber_count %>;
|
||||||
</script>
|
</script>
|
||||||
<% endblock %>
|
<% endblock %>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user