Also show upgrade message and link if key is valid without premium

[MAILPOET-5938]
This commit is contained in:
Brezo Cordero
2024-03-20 14:44:00 -05:00
committed by Aschepikov
parent 28b67db92b
commit f96e6b83d6

View File

@ -86,15 +86,19 @@ export function PremiumBannerWithUpgrade({
ctaButton = getCtaButton(__('Upgrade your plan', 'mailpoet'), link); ctaButton = getCtaButton(__('Upgrade your plan', 'mailpoet'), link);
} else if ( } else if (
hasValidPremiumKey && (hasValidApiKey && !hasValidPremiumKey) || // ex. Starter plan
capabilityName && (hasValidPremiumKey &&
MailPoet.capabilities[capabilityName].isRestricted capabilityName &&
MailPoet.capabilities[capabilityName].isRestricted)
) { ) {
title = __('Upgrade your plan', 'mailpoet'); title = __('Upgrade your plan', 'mailpoet');
bannerMessage = message; bannerMessage = message;
const upgradeParams = capabilityName
? { capability: capabilityName, s: subscribersCount }
: {};
const link = MailPoet.MailPoetComUrlFactory.getUpgradeUrl( const link = MailPoet.MailPoetComUrlFactory.getUpgradeUrl(
pluginPartialKey, pluginPartialKey,
{ capability: capabilityName, s: subscribersCount }, upgradeParams,
); );
ctaButton = getCtaButton(__('Upgrade', 'mailpoet'), link); ctaButton = getCtaButton(__('Upgrade', 'mailpoet'), link);
} else { } else {