Add subscription expired trigger stub

[PREMIUM-246]
This commit is contained in:
David Remer
2023-11-03 10:25:34 +02:00
committed by Aschepikov
parent 305ade3985
commit b64ebeae09
3 changed files with 65 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import { step as SubscriptionTrialEnded } from './steps/subscription-trial-ended
import { step as SubscriptionTrialStarted } from './steps/subscription-trial-started';
import { step as SubscriptionRenewed } from './steps/subscription-renewed';
import { step as SubscriptionPaymentFailed } from './steps/subscription-payment-failed';
import { step as SubscriptionExpired } from './steps/subscription-expired';
import { registerStepType } from '../../editor/store';
export const initialize = (): void => {
@@ -17,5 +18,6 @@ export const initialize = (): void => {
registerStepType(SubscriptionTrialStarted);
registerStepType(SubscriptionRenewed);
registerStepType(SubscriptionPaymentFailed);
registerStepType(SubscriptionExpired);
// Insert new steps here
};

View File

@@ -0,0 +1,26 @@
export function Icon(): JSX.Element {
return (
<svg
width="24"
height="24"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M16.3388 16.8031C15.1919 17.8384 13.6724 18.4688 12.0057 18.4688C8.43315 18.4688 5.53699 15.5726 5.53699 12C5.53699 8.42741 8.43315 5.53125 12.0057 5.53125C15.5783 5.53125 18.4745 8.42741 18.4745 12C18.4745 12.1834 18.4669 12.365 18.4519 12.5445H16.6554L19.1554 15.5445L21.6554 12.5445H19.9562C19.9683 12.3646 19.9745 12.183 19.9745 12C19.9745 7.59898 16.4068 4.03125 12.0057 4.03125C7.60472 4.03125 4.03699 7.59898 4.03699 12C4.03699 16.401 7.60472 19.9688 12.0057 19.9688C14.0973 19.9688 16.0006 19.163 17.4222 17.8449L16.3388 16.8031Z"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M12.9407 12.4462H11.1558V7.98413H12.9407V12.4462Z"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M12.9407 16.0158H11.1558V14.231H12.9407V16.0158Z"
/>
</svg>
);
}

View File

@@ -0,0 +1,37 @@
import { __, _x } from '@wordpress/i18n';
import { StepType } from '../../../../editor/store';
import { Icon } from './icon';
import { PremiumModalForStepEdit } from '../../../../../common/premium-modal';
const keywords = [
__('woocommerce', 'mailpoet'),
__('subscription', 'mailpoet'),
__('expired', 'mailpoet'),
];
export const step: StepType = {
key: 'woocommerce-subscriptions:subscription-expired',
group: 'triggers',
title: () => __('Woo Subscription expired', 'mailpoet'),
description: () =>
__('Start the automation when a subscription expires.', 'mailpoet'),
subtitle: () => _x('Trigger', 'noun', 'mailpoet'),
keywords,
foreground: '#2271b1',
background: '#f0f6fc',
icon: () => <Icon />,
edit: () => (
<PremiumModalForStepEdit
tracking={{
utm_medium: 'upsell_modal',
utm_campaign: 'create_automation_editor_woo_subscription_expired',
}}
>
{__(
'Starting an automation when a subscription expires is a premium feature.',
'mailpoet',
)}
</PremiumModalForStepEdit>
),
} as const;