Add automations info notice on Woo Settings tab
This is for Woo Express customers where the automations are hidden when AutomateWoo is enabled. [MAILPOET-5598]
This commit is contained in:
committed by
Aschepikov
parent
946d4a87f8
commit
d5ea0fab02
42
mailpoet/assets/js/src/notices/automations_info_notice.tsx
Normal file
42
mailpoet/assets/js/src/notices/automations_info_notice.tsx
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import ReactStringReplace from 'react-string-replace';
|
||||||
|
import { MailPoet } from 'mailpoet';
|
||||||
|
import { Notice } from 'notices/notice';
|
||||||
|
|
||||||
|
function AutomationsInfoNotice() {
|
||||||
|
if (!MailPoet.hideAutomations) return null;
|
||||||
|
let automationsInfo = ReactStringReplace(
|
||||||
|
MailPoet.I18n.t('automationsInfoNotice'),
|
||||||
|
/\[link1\](.*?)\[\/link1\]/g,
|
||||||
|
(match) => (
|
||||||
|
<a
|
||||||
|
key={match}
|
||||||
|
rel="noreferrer"
|
||||||
|
href="https://kb.mailpoet.com/article/397-how-to-set-up-an-automation"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
{match}
|
||||||
|
</a>
|
||||||
|
),
|
||||||
|
);
|
||||||
|
automationsInfo = ReactStringReplace(
|
||||||
|
automationsInfo,
|
||||||
|
/\[link2\](.*?)\[\/link2\]/g,
|
||||||
|
(match) => (
|
||||||
|
<a
|
||||||
|
key={match}
|
||||||
|
rel="noreferrer"
|
||||||
|
href="https://href.li/?https://kb.mailpoet.com/article/408-integration-with-automatewoo"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
{match}
|
||||||
|
</a>
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<Notice type="warning" scroll renderInPlace timeout={false}>
|
||||||
|
<p>{automationsInfo}</p>
|
||||||
|
</Notice>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export { AutomationsInfoNotice };
|
@@ -1,15 +1,19 @@
|
|||||||
import { SaveButton } from 'settings/components';
|
import { SaveButton } from 'settings/components';
|
||||||
|
import { AutomationsInfoNotice } from 'notices/automations_info_notice';
|
||||||
import { EmailCustomizer } from './email_customizer';
|
import { EmailCustomizer } from './email_customizer';
|
||||||
import { CheckoutOptin } from './checkout_optin';
|
import { CheckoutOptin } from './checkout_optin';
|
||||||
import { SubscribeOldCustomers } from './subscribe_old_customers';
|
import { SubscribeOldCustomers } from './subscribe_old_customers';
|
||||||
|
|
||||||
export function WooCommerce() {
|
export function WooCommerce() {
|
||||||
return (
|
return (
|
||||||
<div className="mailpoet-settings-grid">
|
<>
|
||||||
<EmailCustomizer />
|
<AutomationsInfoNotice />
|
||||||
<CheckoutOptin />
|
<div className="mailpoet-settings-grid">
|
||||||
<SubscribeOldCustomers />
|
<EmailCustomizer />
|
||||||
<SaveButton />
|
<CheckoutOptin />
|
||||||
</div>
|
<SubscribeOldCustomers />
|
||||||
|
<SaveButton />
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -168,6 +168,7 @@
|
|||||||
'wcOptinMsgCannotBeEmpty': __('The checkbox opt-in message cannot be empty.'),
|
'wcOptinMsgCannotBeEmpty': __('The checkbox opt-in message cannot be empty.'),
|
||||||
'subscribeOldWCTitle': __('Subscribe old WooCommerce customers'),
|
'subscribeOldWCTitle': __('Subscribe old WooCommerce customers'),
|
||||||
'subscribeOldWCDescription': __('Subscribe all my past customers to this list because they agreed to receive marketing emails from me.'),
|
'subscribeOldWCDescription': __('Subscribe all my past customers to this list because they agreed to receive marketing emails from me.'),
|
||||||
|
'automationsInfoNotice': __('Looking for [link1]MailPoet Automations[/link1]? Read how to [link2]enable them[/link2].'),
|
||||||
|
|
||||||
'mssTitle': __('MailPoet Sending Service'),
|
'mssTitle': __('MailPoet Sending Service'),
|
||||||
'youreSendingWithMss': __("You're now sending with MailPoet!"),
|
'youreSendingWithMss': __("You're now sending with MailPoet!"),
|
||||||
|
Reference in New Issue
Block a user