diff --git a/assets/js/src/subscribers/form.jsx b/assets/js/src/subscribers/form.jsx index 4dc85cb592..5970e50594 100644 --- a/assets/js/src/subscribers/form.jsx +++ b/assets/js/src/subscribers/form.jsx @@ -4,6 +4,7 @@ import MailPoet from 'mailpoet'; import PropTypes from 'prop-types'; import Form from 'form/form.jsx'; import ReactStringReplace from 'react-string-replace'; +import SubscribersLimitNotice from 'notices/subscribers_limit_notice.jsx'; const fields = [ { @@ -184,6 +185,8 @@ class SubscriberForm extends React.Component { // eslint-disable-line react/pref {MailPoet.I18n.t('backToList')} + +
+ + pageRenderer = $pageRenderer; $this->listingPageLimit = $listingPageLimit; + $this->subscribersFeature = $subscribersFeature; $this->wp = $wp; } @@ -61,6 +67,11 @@ class Subscribers { $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); } } diff --git a/views/layout.html b/views/layout.html index 2b6fbaefdc..cb7f9c6cf5 100644 --- a/views/layout.html +++ b/views/layout.html @@ -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'), '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 %> diff --git a/views/newsletters.html b/views/newsletters.html index 8e74f8cab5..e228ea26a7 100644 --- a/views/newsletters.html +++ b/views/newsletters.html @@ -398,13 +398,6 @@ 'gaCampaignLine': __('Google Analytics Campaign'), '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') %> <% endblock %> diff --git a/views/subscribers/subscribers.html b/views/subscribers/subscribers.html index 94ed752b66..283f71fdf9 100644 --- a/views/subscribers/subscribers.html +++ b/views/subscribers/subscribers.html @@ -19,6 +19,10 @@ '5cbf19622c7d3a026fd3efe1', '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 %>; <% endblock %>