Append subscribers limit notice with info about WP users segment

[MAILPOET-3143]
This commit is contained in:
Rostislav Wolny
2021-01-07 15:36:16 +01:00
committed by Veljko V
parent 0eb60a4880
commit e576002d70
5 changed files with 33 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ var MailPoet = {
libs3rdPartyEnabled: window.mailpoet_3rd_party_libs_enabled,
apiVersion: window.mailpoet_api_version,
emailRegex: window.mailpoet_email_regex,
wpSegmentState: window.mailpoet_wp_segment_state,
getShortcodeLinks: () => (window.mailpoet_shortcode_links ? window.mailpoet_shortcode_links : []),
};

View File

@@ -1,4 +1,5 @@
import React from 'react';
import ReactStringReplace from 'react-string-replace';
import MailPoet from 'mailpoet';
import Notice from 'notices/notice.tsx';
@@ -21,6 +22,14 @@ const SubscribersLimitNotice = () => {
window.location.reload();
};
const youCanDisableWpSegmentMessage = ReactStringReplace(
MailPoet.I18n.t('youCanDisableWPUsersList'),
/\[link](.*?)\[\/link]/g,
(match) => (
<a key="goToSegments" href="?page=mailpoet-segments">{match}</a>
)
);
return (
<Notice type="error" timeout={false} closable={false} renderInPlace>
<h3>{title}</h3>
@@ -28,6 +37,12 @@ const SubscribersLimitNotice = () => {
{youReachedTheLimit}
{' '}
{MailPoet.I18n.t('youNeedToUpgrade')}
{MailPoet.wpSegmentState === 'active' ? (
<>
<br />
{youCanDisableWpSegmentMessage}
</>
) : null}
</p>
<p>
<a