From d5ea0fab0249b3214906df14da2c3780a6cd75d5 Mon Sep 17 00:00:00 2001
From: Brezo Cordero <8002881+brezocordero@users.noreply.github.com>
Date: Thu, 21 Sep 2023 16:30:03 -0500
Subject: [PATCH] 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]
---
.../src/notices/automations_info_notice.tsx | 42 +++++++++++++++++++
.../pages/woo_commerce/woo_commerce.tsx | 16 ++++---
mailpoet/views/settings_translations.html | 1 +
3 files changed, 53 insertions(+), 6 deletions(-)
create mode 100644 mailpoet/assets/js/src/notices/automations_info_notice.tsx
diff --git a/mailpoet/assets/js/src/notices/automations_info_notice.tsx b/mailpoet/assets/js/src/notices/automations_info_notice.tsx
new file mode 100644
index 0000000000..09e0f6c6d2
--- /dev/null
+++ b/mailpoet/assets/js/src/notices/automations_info_notice.tsx
@@ -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) => (
+
+ {match}
+
+ ),
+ );
+ automationsInfo = ReactStringReplace(
+ automationsInfo,
+ /\[link2\](.*?)\[\/link2\]/g,
+ (match) => (
+
+ {match}
+
+ ),
+ );
+ return (
+ {automationsInfo}