diff --git a/mailpoet/assets/js/src/automation/sections/build-your-own-section.tsx b/mailpoet/assets/js/src/automation/sections/build-your-own-section.tsx index 526d48bf25..d260f6c79c 100644 --- a/mailpoet/assets/js/src/automation/sections/build-your-own-section.tsx +++ b/mailpoet/assets/js/src/automation/sections/build-your-own-section.tsx @@ -12,7 +12,7 @@ export function BuildYourOwnSection(): JSX.Element { 'Deliver relevant messages to your customers based on who they are and how they interact with your business.', 'mailpoet', ), - image: `${MailPoet.urls.imageAssets}automation/sections/start-with-a-trigger.png`, + image: `${MailPoet.cdnUrl}automation/sections/start-with-a-trigger.png`, }, { slug: 'customize-your-workflow', @@ -21,7 +21,7 @@ export function BuildYourOwnSection(): JSX.Element { 'Choose steps and create a custom journey to best suit your needs.', 'mailpoet', ), - image: `${MailPoet.urls.imageAssets}automation/sections/customize-your-workflow.png`, + image: `${MailPoet.cdnUrl}automation/sections/customize-your-workflow.png`, }, { slug: 'design-your-email', @@ -30,7 +30,7 @@ export function BuildYourOwnSection(): JSX.Element { 'Modify one of our pre-made email templates or create your own design.', 'mailpoet', ), - image: `${MailPoet.urls.imageAssets}automation/sections/design-your-email.png`, + image: `${MailPoet.cdnUrl}automation/sections/design-your-email.png`, }, { slug: 'start-engaging', @@ -39,7 +39,7 @@ export function BuildYourOwnSection(): JSX.Element { 'Activate the automation and start engaging with your customers as they interact with your business.', 'mailpoet', ), - image: `${MailPoet.urls.imageAssets}automation/sections/start-engaging.png`, + image: `${MailPoet.cdnUrl}automation/sections/start-engaging.png`, }, ]; diff --git a/mailpoet/assets/js/src/automation/sections/hero-section.tsx b/mailpoet/assets/js/src/automation/sections/hero-section.tsx index 8a9141a3fb..f5654f912f 100644 --- a/mailpoet/assets/js/src/automation/sections/hero-section.tsx +++ b/mailpoet/assets/js/src/automation/sections/hero-section.tsx @@ -33,7 +33,7 @@ export function HeroSection(): JSX.Element { {__('Welcome', diff --git a/mailpoet/assets/js/src/global.d.ts b/mailpoet/assets/js/src/global.d.ts index 5e6325a5d7..aad2da87d5 100644 --- a/mailpoet/assets/js/src/global.d.ts +++ b/mailpoet/assets/js/src/global.d.ts @@ -141,4 +141,5 @@ interface Window { id: number; name: string; }[]; + mailpoet_cdn_url: string; } diff --git a/mailpoet/assets/js/src/mailpoet.ts b/mailpoet/assets/js/src/mailpoet.ts index ef79de277e..0be521c3dd 100644 --- a/mailpoet/assets/js/src/mailpoet.ts +++ b/mailpoet/assets/js/src/mailpoet.ts @@ -64,6 +64,7 @@ export const MailPoet = { deactivateSubscriberAfterInactiveDays: window.mailpoet_deactivate_subscriber_after_inactive_days, tags: window.mailpoet_tags, + cdnUrl: window.mailpoet_cdn_url, } as const; declare global { diff --git a/mailpoet/lib/AdminPages/PageRenderer.php b/mailpoet/lib/AdminPages/PageRenderer.php index 26cd65a565..c4c9605cd5 100644 --- a/mailpoet/lib/AdminPages/PageRenderer.php +++ b/mailpoet/lib/AdminPages/PageRenderer.php @@ -3,7 +3,6 @@ namespace MailPoet\AdminPages; use MailPoet\Cache\TransientCache; -use MailPoet\Config\Env; use MailPoet\Config\Installer; use MailPoet\Config\Renderer; use MailPoet\Config\ServicesChecker; @@ -156,7 +155,6 @@ class PageRenderer { 'automationListing' => admin_url('admin.php?page=mailpoet-automation'), 'automationEditor' => admin_url('admin.php?page=mailpoet-automation-editor'), 'automationTemplates' => admin_url('admin.php?page=mailpoet-automation-templates'), - 'imageAssets' => plugin_dir_url(Env::$file) . 'assets/img/', ], ]; diff --git a/mailpoet/assets/img/automation/sections/customize-your-workflow.png b/mailpoet/plugin_repository/assets/automation/sections/customize-your-workflow.png similarity index 100% rename from mailpoet/assets/img/automation/sections/customize-your-workflow.png rename to mailpoet/plugin_repository/assets/automation/sections/customize-your-workflow.png diff --git a/mailpoet/assets/img/automation/sections/design-your-email.png b/mailpoet/plugin_repository/assets/automation/sections/design-your-email.png similarity index 100% rename from mailpoet/assets/img/automation/sections/design-your-email.png rename to mailpoet/plugin_repository/assets/automation/sections/design-your-email.png diff --git a/mailpoet/assets/img/automation/sections/hero.png b/mailpoet/plugin_repository/assets/automation/sections/hero.png similarity index 100% rename from mailpoet/assets/img/automation/sections/hero.png rename to mailpoet/plugin_repository/assets/automation/sections/hero.png diff --git a/mailpoet/assets/img/automation/sections/start-engaging.png b/mailpoet/plugin_repository/assets/automation/sections/start-engaging.png similarity index 100% rename from mailpoet/assets/img/automation/sections/start-engaging.png rename to mailpoet/plugin_repository/assets/automation/sections/start-engaging.png diff --git a/mailpoet/assets/img/automation/sections/start-with-a-trigger.png b/mailpoet/plugin_repository/assets/automation/sections/start-with-a-trigger.png similarity index 100% rename from mailpoet/assets/img/automation/sections/start-with-a-trigger.png rename to mailpoet/plugin_repository/assets/automation/sections/start-with-a-trigger.png diff --git a/mailpoet/views/layout.html b/mailpoet/views/layout.html index 03e10da547..b673993ee3 100644 --- a/mailpoet/views/layout.html +++ b/mailpoet/views/layout.html @@ -102,6 +102,7 @@ jQuery('#adminmenu #toplevel_page_mailpoet-newsletters') var mailpoet_subscribers_limit_reached = <%= json_encode(subscribers_limit_reached) %>; var mailpoet_email_volume_limit = <%= json_encode(email_volume_limit) %>; var mailpoet_email_volume_limit_reached = <%= json_encode(email_volume_limit_reached) %>; + var mailpoet_cdn_url = <%= json_encode(cdn_url("")) %>; <% if not(premium_plugin_active) %> var mailpoet_free_premium_subscribers_limit = <%= free_premium_subscribers_limit %>;