diff --git a/assets/js/src/listing/listing.jsx b/assets/js/src/listing/listing.jsx index 3cf9b7799d..1979346405 100644 --- a/assets/js/src/listing/listing.jsx +++ b/assets/js/src/listing/listing.jsx @@ -198,6 +198,17 @@ const ListingItem = React.createClass({ const ListingItems = React.createClass({ render: function() { if (this.props.items.length === 0) { + let message; + if (this.props.loading === true) { + message = (this.props.messages.onLoadingItems + && this.props.messages.onLoadingItems(this.props.group)) + || MailPoet.I18n.t('loadingItems'); + } else { + message = (this.props.messages.onNoItemsFound + && this.props.messages.onNoItemsFound(this.props.group)) + || MailPoet.I18n.t('noItemsFound'); + } + return ( @@ -207,11 +218,7 @@ const ListingItems = React.createClass({ + (this.props.is_selectable ? 1 : 0) } className="colspanchange"> - { - (this.props.loading === true) - ? (this.props.messages.onLoadingItems || MailPoet.I18n.t('loadingItems')) - : (this.props.messages.onNoItemsFound || MailPoet.I18n.t('noItemsFound')) - } + {message} diff --git a/assets/js/src/subscribers/list.jsx b/assets/js/src/subscribers/list.jsx index cb263a5501..63cba565cd 100644 --- a/assets/js/src/subscribers/list.jsx +++ b/assets/js/src/subscribers/list.jsx @@ -81,6 +81,22 @@ const messages = { ).replace('%$1d', count.toLocaleString()); } MailPoet.Notice.success(message); + }, + onNoItemsFound: (group) => { + if (group === 'bounced' && !mailpoet_premium_active) { + return ( +
+

{MailPoet.I18n.t('bouncedSubscribersHelp')}

+

+ + {MailPoet.I18n.t('bouncedSubscribersPremiumButtonText')} + +

+
+ ); + } + // use default message + return false; } }; diff --git a/lib/Config/Menu.php b/lib/Config/Menu.php index bc59820c07..b40fa60b53 100644 --- a/lib/Config/Menu.php +++ b/lib/Config/Menu.php @@ -378,6 +378,8 @@ class Menu { $data['date_formats'] = Block\Date::getDateFormats(); $data['month_names'] = Block\Date::getMonthNames(); + $data['premium_plugin_active'] = License::getLicense(); + $this->displayPage('subscribers/subscribers.html', $data); } diff --git a/views/subscribers/subscribers.html b/views/subscribers/subscribers.html index b6a20f44cb..18ceebe6dc 100644 --- a/views/subscribers/subscribers.html +++ b/views/subscribers/subscribers.html @@ -9,6 +9,7 @@ var mailpoet_custom_fields = <%= json_encode(custom_fields) %>; var mailpoet_month_names = <%= json_encode(month_names) %>; var mailpoet_date_formats = <%= json_encode(date_formats) %>; + var mailpoet_premium_active = <%= json_encode(premium_plugin_active) %>; <% endblock %> @@ -18,6 +19,8 @@ 'searchLabel': __('Search'), 'loadingItems': __('Loading subscribers...'), 'noItemsFound': __('No subscribers were found.'), + 'bouncedSubscribersHelp': __("Emails that are invalid or don't exist anymore are called \"bounced addresses\". It's a good practice not to send emails to bounced addresses to keep a good reputation with spam filters. Send your emails with MailPoet and we'll automatically ensure to keep a list of bounced addresses without any setup."), + 'bouncedSubscribersPremiumButtonText': __('Check out the Premium'), 'selectAllLabel': __('All subscribers on this page are selected.'), 'selectedAllLabel': __('All %d subscribers are selected.'), 'selectAllLink': __('Select all subscribers on all pages.'),