Use cdn url for automation assets

[MAILPOET-4536]
This commit is contained in:
David Remer
2022-11-03 08:42:33 +02:00
committed by Jan Jakeš
parent e0458ca444
commit 945ff65358
11 changed files with 8 additions and 7 deletions

View File

@ -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.', 'Deliver relevant messages to your customers based on who they are and how they interact with your business.',
'mailpoet', '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', 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.', 'Choose steps and create a custom journey to best suit your needs.',
'mailpoet', 'mailpoet',
), ),
image: `${MailPoet.urls.imageAssets}automation/sections/customize-your-workflow.png`, image: `${MailPoet.cdnUrl}automation/sections/customize-your-workflow.png`,
}, },
{ {
slug: 'design-your-email', 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.', 'Modify one of our pre-made email templates or create your own design.',
'mailpoet', 'mailpoet',
), ),
image: `${MailPoet.urls.imageAssets}automation/sections/design-your-email.png`, image: `${MailPoet.cdnUrl}automation/sections/design-your-email.png`,
}, },
{ {
slug: 'start-engaging', 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.', 'Activate the automation and start engaging with your customers as they interact with your business.',
'mailpoet', 'mailpoet',
), ),
image: `${MailPoet.urls.imageAssets}automation/sections/start-engaging.png`, image: `${MailPoet.cdnUrl}automation/sections/start-engaging.png`,
}, },
]; ];

View File

@ -33,7 +33,7 @@ export function HeroSection(): JSX.Element {
</OptionButton> </OptionButton>
</div> </div>
<img <img
src={`${MailPoet.urls.imageAssets}automation/sections/hero.png`} src={`${MailPoet.cdnUrl}automation/sections/hero.png`}
alt={__('Welcome', 'mailpoet')} alt={__('Welcome', 'mailpoet')}
/> />
</section> </section>

View File

@ -141,4 +141,5 @@ interface Window {
id: number; id: number;
name: string; name: string;
}[]; }[];
mailpoet_cdn_url: string;
} }

View File

@ -64,6 +64,7 @@ export const MailPoet = {
deactivateSubscriberAfterInactiveDays: deactivateSubscriberAfterInactiveDays:
window.mailpoet_deactivate_subscriber_after_inactive_days, window.mailpoet_deactivate_subscriber_after_inactive_days,
tags: window.mailpoet_tags, tags: window.mailpoet_tags,
cdnUrl: window.mailpoet_cdn_url,
} as const; } as const;
declare global { declare global {

View File

@ -3,7 +3,6 @@
namespace MailPoet\AdminPages; namespace MailPoet\AdminPages;
use MailPoet\Cache\TransientCache; use MailPoet\Cache\TransientCache;
use MailPoet\Config\Env;
use MailPoet\Config\Installer; use MailPoet\Config\Installer;
use MailPoet\Config\Renderer; use MailPoet\Config\Renderer;
use MailPoet\Config\ServicesChecker; use MailPoet\Config\ServicesChecker;
@ -156,7 +155,6 @@ class PageRenderer {
'automationListing' => admin_url('admin.php?page=mailpoet-automation'), 'automationListing' => admin_url('admin.php?page=mailpoet-automation'),
'automationEditor' => admin_url('admin.php?page=mailpoet-automation-editor'), 'automationEditor' => admin_url('admin.php?page=mailpoet-automation-editor'),
'automationTemplates' => admin_url('admin.php?page=mailpoet-automation-templates'), 'automationTemplates' => admin_url('admin.php?page=mailpoet-automation-templates'),
'imageAssets' => plugin_dir_url(Env::$file) . 'assets/img/',
], ],
]; ];

View File

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

View File

Before

Width:  |  Height:  |  Size: 213 KiB

After

Width:  |  Height:  |  Size: 213 KiB

View File

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

View File

@ -102,6 +102,7 @@ jQuery('#adminmenu #toplevel_page_mailpoet-newsletters')
var mailpoet_subscribers_limit_reached = <%= json_encode(subscribers_limit_reached) %>; 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 = <%= json_encode(email_volume_limit) %>;
var mailpoet_email_volume_limit_reached = <%= json_encode(email_volume_limit_reached) %>; 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) %> <% if not(premium_plugin_active) %>
var mailpoet_free_premium_subscribers_limit = <%= free_premium_subscribers_limit %>; var mailpoet_free_premium_subscribers_limit = <%= free_premium_subscribers_limit %>;