Convert loadedvia part to URL search param instead of URL hash

MAILPOET-5701
This commit is contained in:
Oluwaseun Olorunsola
2023-12-06 07:08:00 +01:00
committed by Aschepikov
parent ddde17f83a
commit c957cc0c2b
4 changed files with 11 additions and 7 deletions

View File

@@ -195,11 +195,11 @@ const routes = [
},
/* New newsletter: types */
{
path: '/new/standard/(.*)?',
path: '/new/standard',
render: withBoundary(NewsletterTypeStandard),
},
{
path: '/new/notification/(.*)?',
path: '/new/notification',
render: withBoundary(NewsletterNotification),
},
{

View File

@@ -34,7 +34,9 @@ class NewsletterNotificationComponent extends Component {
}
componentDidMount() {
if (window.location.hash.includes('loadedvia=woo_multichannel_dashboard')) {
if (
window.location.search.includes('loadedvia=woo_multichannel_dashboard')
) {
window.MailPoet.trackEvent(
'MailPoet - WooCommerce Multichannel Marketing dashboard > Create post notification page',
{

View File

@@ -21,7 +21,9 @@ class NewsletterStandardComponent extends Component {
})
.done((response) => {
if (
window.location.hash.includes('loadedvia=woo_multichannel_dashboard')
window.location.search.includes(
'loadedvia=woo_multichannel_dashboard',
)
) {
window.MailPoet.trackEvent(
'MailPoet - WooCommerce Multichannel Marketing dashboard > Newsletter template selection page',

View File

@@ -157,7 +157,7 @@ class MPMarketingChannel implements MarketingChannelInterface {
'Send a newsletter with images, buttons, dividers, and social bookmarks. Or, just send a basic text email.',
'mailpoet',
),
admin_url('admin.php?page=' . Menu::EMAILS_PAGE_SLUG . '#/new/standard/loadedvia=woo_multichannel_dashboard'),
admin_url('admin.php?loadedvia=woo_multichannel_dashboard&page=' . Menu::EMAILS_PAGE_SLUG . '#/new/standard'),
$this->get_icon_url()
),
self::CAMPAIGN_TYPE_POST_NOTIFICATIONS => new MarketingCampaignType(
@@ -168,7 +168,7 @@ class MPMarketingChannel implements MarketingChannelInterface {
'Let MailPoet email your subscribers with your latest content. You can send daily, weekly, monthly, or even immediately after publication.',
'mailpoet',
),
admin_url('admin.php?page=' . Menu::EMAILS_PAGE_SLUG . '#/new/notification/loadedvia=woo_multichannel_dashboard'),
admin_url('admin.php?loadedvia=woo_multichannel_dashboard&page=' . Menu::EMAILS_PAGE_SLUG . '#/new/notification'),
$this->get_icon_url()
),
self::CAMPAIGN_TYPE_AUTOMATIONS => new MarketingCampaignType(
@@ -176,7 +176,7 @@ class MPMarketingChannel implements MarketingChannelInterface {
$this,
__('MailPoet Automations', 'mailpoet'),
__('Set up automations to send abandoned cart reminders, welcome new subscribers, celebrate first-time buyers, and much more.', 'mailpoet'),
admin_url('admin.php?page=' . Menu::AUTOMATION_TEMPLATES_PAGE_SLUG . '&loadedvia=woo_multichannel_dashboard'),
admin_url('admin.php?loadedvia=woo_multichannel_dashboard&page=' . Menu::AUTOMATION_TEMPLATES_PAGE_SLUG),
$this->get_icon_url()
),
];