Feat: Add upgraded and failed event (#3683)

This commit is contained in:
Mike
2024-12-12 15:44:42 +01:00
committed by GitHub
parent 60ff23d73d
commit 222f3ddb5b
@@ -199,12 +199,24 @@ export const useBillingActions = () => {
type: ToastNotificationType.Danger,
title: 'Your payment was canceled'
})
mixpanel.track('Workspace Upgrade Cancelled', {
// eslint-disable-next-line camelcase
workspace_id: workspace.id
})
} else {
triggerNotification({
type: ToastNotificationType.Success,
title: 'Your workspace plan was successfully updated'
})
mixpanel.track('Workspace Upgraded', {
plan: workspace.plan?.name,
cycle: workspace.subscription?.billingInterval,
// eslint-disable-next-line camelcase
workspace_id: workspace.id
})
if (import.meta.server) {
await sendWebhook(defaultZapierWebhookUrl, {
workspaceId: workspace.id,