Update the upgrade modal msg for automation steps

And handle numeric capabilities

[MAILPOET-5938]
This commit is contained in:
Brezo Cordero
2024-03-13 13:11:54 -05:00
committed by Aschepikov
parent 020aee53aa
commit 5d267b1a41
2 changed files with 26 additions and 11 deletions

View File

@ -58,6 +58,7 @@ export function InserterPopover(): JSX.Element | null {
utm_medium: 'upsell_modal',
utm_campaign: 'add_automation_step',
}}
data={{ capabilityName: 'automationSteps' }}
>
{__('You cannot add a new step to the automation.', 'mailpoet')}
</PremiumModal>

View File

@ -145,19 +145,33 @@ export const getUpgradeInfo = (
// f. User has a license but the feature is not available for the plan.
if (
capabilityName &&
typeof MailPoet.capabilities[capabilityName] === 'boolean' &&
!MailPoet.capabilities[capabilityName]
((typeof MailPoet.capabilities[capabilityName] === 'boolean' &&
!MailPoet.capabilities[capabilityName]) ||
(typeof MailPoet.capabilities[capabilityName] === 'number' &&
MailPoet.capabilities[capabilityName] > 0))
) {
let info = __(
'Please upgrade your MailPoet plan to gain access to this feature.',
'mailpoet',
);
if (capabilityName === 'detailedAnalytics') {
info = __(
'Upgrade your MailPoet plan to gain detailed insights into how your subscribers engage with your automations and their purchasing behaviors.',
'mailpoet',
);
let info: string;
switch (capabilityName) {
case 'detailedAnalytics':
info = __(
'Upgrade your MailPoet plan to gain detailed insights into how your subscribers engage with your automations and their purchasing behaviors.',
'mailpoet',
);
break;
case 'automationSteps':
info = __(
'Automation journeys are not available in your current plan. Upgrade your MailPoet plan to design personalized journeys with multiple steps and conditional branching logic.',
'mailpoet',
);
break;
default:
info = __(
'Please upgrade your MailPoet plan to gain access to this feature.',
'mailpoet',
);
}
return {
title: __('Upgrade your MailPoet plan', 'mailpoet'),
info,