fix: remove follow-ups from trial features and gate trial page for subscribers (#7465)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Dhruwang Jariwala
2026-03-13 15:30:23 +05:30
committed by Dhruwang
parent 0df5e26381
commit 6917197777
17 changed files with 14 additions and 16 deletions

View File

@@ -1,8 +1,12 @@
import { redirect } from "next/navigation";
import { TCloudBillingPlan } from "@formbricks/types/organizations";
import { IS_FORMBRICKS_CLOUD } from "@/lib/constants";
import { getOrganizationBillingWithReadThroughSync } from "@/modules/ee/billing/lib/organization-billing";
import { getOrganizationAuth } from "@/modules/organization/lib/utils";
import { SelectPlanOnboarding } from "./components/select-plan-onboarding";
const PAID_PLANS = new Set<TCloudBillingPlan>(["pro", "scale", "custom"]);
interface PlanPageProps {
params: Promise<{
organizationId: string;
@@ -22,6 +26,16 @@ const Page = async (props: PlanPageProps) => {
return redirect(`/auth/login`);
}
// Users with an existing paid/trial subscription should not be shown the trial page.
// Redirect them directly to the next onboarding step.
const billing = await getOrganizationBillingWithReadThroughSync(params.organizationId);
const currentPlan = billing?.stripe?.plan;
const hasExistingSubscription = currentPlan !== undefined && PAID_PLANS.has(currentPlan);
if (hasExistingSubscription) {
return redirect(`/organizations/${params.organizationId}/workspaces/new/mode`);
}
return <SelectPlanOnboarding organizationId={params.organizationId} />;
};

View File

@@ -940,7 +940,6 @@ checksums:
environments/settings/billing/trial_already_used: 5433347ff7647fe0aba0fe91a44560ba
environments/settings/billing/trial_feature_api_access: d7aabb2de18beb5bd30c274cd768a2a9
environments/settings/billing/trial_feature_collaboration: a43509fffe319e14d69a981ef2791517
environments/settings/billing/trial_feature_email_followups: add368efdd84c5aef8886f369d54cbed
environments/settings/billing/trial_feature_quotas: 3a67818b3901bdaa72abc62db72ab170
environments/settings/billing/trial_feature_webhooks: 8d7f034e006b2fe0eb8fa9b8f1abef51
environments/settings/billing/trial_feature_whitelabel: 624a7aeca6a0fa65935c63fd7a8e9638

View File

@@ -995,7 +995,6 @@
"trial_already_used": "Für diese E-Mail-Adresse wurde bereits eine kostenlose Testversion genutzt. Bitte upgraden Sie stattdessen auf einen kostenpflichtigen Plan.",
"trial_feature_api_access": "Vollen API-Zugriff erhalten",
"trial_feature_collaboration": "Alle Team- und Kollaborationsfunktionen",
"trial_feature_email_followups": "E-Mail-Nachfassaktionen einrichten",
"trial_feature_quotas": "Kontingente verwalten",
"trial_feature_webhooks": "Benutzerdefinierte Webhooks einrichten",
"trial_feature_whitelabel": "Vollständig white-labeled Umfragen",

View File

@@ -995,7 +995,6 @@
"trial_already_used": "A free trial has already been used for this email address. Please upgrade to a paid plan instead.",
"trial_feature_api_access": "Get full API access",
"trial_feature_collaboration": "All team & collaboration features",
"trial_feature_email_followups": "Setup email follow-ups",
"trial_feature_quotas": "Manage quotas",
"trial_feature_webhooks": "Setup custom webhooks",
"trial_feature_whitelabel": "Fully white-labeled surveys",

View File

@@ -995,7 +995,6 @@
"trial_already_used": "Ya se ha utilizado una prueba gratuita para esta dirección de correo electrónico. Por favor, actualiza a un plan de pago.",
"trial_feature_api_access": "Acceso completo a la API",
"trial_feature_collaboration": "Todas las funciones de equipo y colaboración",
"trial_feature_email_followups": "Configurar seguimientos por correo electrónico",
"trial_feature_quotas": "Gestionar cuotas",
"trial_feature_webhooks": "Configurar webhooks personalizados",
"trial_feature_whitelabel": "Encuestas totalmente personalizadas",

View File

@@ -995,7 +995,6 @@
"trial_already_used": "Un essai gratuit a déjà été utilisé pour cette adresse e-mail. Passe plutôt à un plan payant.",
"trial_feature_api_access": "Accès complet à l'API",
"trial_feature_collaboration": "Toutes les fonctionnalités d'équipe et de collaboration",
"trial_feature_email_followups": "Configure des relances par e-mail",
"trial_feature_quotas": "Gère les quotas",
"trial_feature_webhooks": "Configure des webhooks personnalisés",
"trial_feature_whitelabel": "Enquêtes entièrement en marque blanche",

View File

@@ -995,7 +995,6 @@
"trial_already_used": "Ehhez az e-mail címhez már igénybe vettek ingyenes próbaidőszakot. Kérjük, válasszon helyette fizetős csomagot.",
"trial_feature_api_access": "Teljes API-hozzáférés megszerzése",
"trial_feature_collaboration": "Minden csapat- és együttműködési funkció",
"trial_feature_email_followups": "E-mail követések beállítása",
"trial_feature_quotas": "Kvóták kezelése",
"trial_feature_webhooks": "Egyéni webhookok beállítása",
"trial_feature_whitelabel": "Teljesen fehércímkés felmérések",

View File

@@ -995,7 +995,6 @@
"trial_already_used": "このメールアドレスでは既に無料トライアルが使用されています。代わりに有料プランにアップグレードしてください。",
"trial_feature_api_access": "フルAPIアクセスを利用",
"trial_feature_collaboration": "すべてのチーム・コラボレーション機能",
"trial_feature_email_followups": "メールフォローアップの設定",
"trial_feature_quotas": "クォータの管理",
"trial_feature_webhooks": "カスタムWebhookの設定",
"trial_feature_whitelabel": "完全ホワイトラベル対応のアンケート",

View File

@@ -995,7 +995,6 @@
"trial_already_used": "Er is al een gratis proefperiode gebruikt voor dit e-mailadres. Upgrade in plaats daarvan naar een betaald abonnement.",
"trial_feature_api_access": "Krijg volledige API-toegang",
"trial_feature_collaboration": "Alle team- en samenwerkingsfuncties",
"trial_feature_email_followups": "E-mail follow-ups instellen",
"trial_feature_quotas": "Quota's beheren",
"trial_feature_webhooks": "Aangepaste webhooks instellen",
"trial_feature_whitelabel": "Volledig white-label enquêtes",

View File

@@ -995,7 +995,6 @@
"trial_already_used": "Um período de teste gratuito já foi usado para este endereço de e-mail. Por favor, faça upgrade para um plano pago.",
"trial_feature_api_access": "Obtenha acesso completo à API",
"trial_feature_collaboration": "Todos os recursos de equipe e colaboração",
"trial_feature_email_followups": "Configure acompanhamentos por e-mail",
"trial_feature_quotas": "Gerencie cotas",
"trial_feature_webhooks": "Configure webhooks personalizados",
"trial_feature_whitelabel": "Pesquisas totalmente personalizadas",

View File

@@ -995,7 +995,6 @@
"trial_already_used": "Já foi utilizado um período de teste gratuito para este endereço de email. Por favor, atualiza para um plano pago.",
"trial_feature_api_access": "Obtém acesso completo à API",
"trial_feature_collaboration": "Todas as funcionalidades de equipa e colaboração",
"trial_feature_email_followups": "Configura acompanhamentos por email",
"trial_feature_quotas": "Gere quotas",
"trial_feature_webhooks": "Configura webhooks personalizados",
"trial_feature_whitelabel": "Inquéritos totalmente personalizados",

View File

@@ -995,7 +995,6 @@
"trial_already_used": "O perioadă de probă gratuită a fost deja utilizată pentru această adresă de email. Te rugăm să treci la un plan plătit în schimb.",
"trial_feature_api_access": "Obține acces complet la API",
"trial_feature_collaboration": "Toate funcțiile de echipă și colaborare",
"trial_feature_email_followups": "Configurează urmăriri prin email",
"trial_feature_quotas": "Gestionează cotele",
"trial_feature_webhooks": "Configurează webhook-uri personalizate",
"trial_feature_whitelabel": "Chestionare complet personalizate (white-label)",

View File

@@ -995,7 +995,6 @@
"trial_already_used": "Бесплатный пробный период уже был использован для этого адреса электронной почты. Пожалуйста, перейдите на платный тариф.",
"trial_feature_api_access": "Получите полный доступ к API",
"trial_feature_collaboration": "Все функции для работы в команде и совместной работы",
"trial_feature_email_followups": "Настройте последующие письма",
"trial_feature_quotas": "Управляйте квотами",
"trial_feature_webhooks": "Настройте собственные вебхуки",
"trial_feature_whitelabel": "Полностью персонализированные опросы без брендинга",

View File

@@ -995,7 +995,6 @@
"trial_already_used": "En gratis provperiod har redan använts för denna e-postadress. Uppgradera till en betald plan istället.",
"trial_feature_api_access": "Få full API-åtkomst",
"trial_feature_collaboration": "Alla team- och samarbetsfunktioner",
"trial_feature_email_followups": "Konfigurera uppföljningsmejl",
"trial_feature_quotas": "Hantera kvoter",
"trial_feature_webhooks": "Konfigurera anpassade webhooks",
"trial_feature_whitelabel": "Helt white-label-anpassade enkäter",

View File

@@ -995,7 +995,6 @@
"trial_already_used": "该邮箱地址已使用过免费试用。请升级至付费计划。",
"trial_feature_api_access": "获取完整 API 访问权限",
"trial_feature_collaboration": "所有团队和协作功能",
"trial_feature_email_followups": "设置邮件跟进",
"trial_feature_quotas": "管理配额",
"trial_feature_webhooks": "设置自定义 Webhook",
"trial_feature_whitelabel": "完全白标化的问卷调查",

View File

@@ -995,7 +995,6 @@
"trial_already_used": "此電子郵件地址已使用過免費試用。請改為升級至付費方案。",
"trial_feature_api_access": "獲得完整 API 存取權限",
"trial_feature_collaboration": "所有團隊與協作功能",
"trial_feature_email_followups": "設定電子郵件追蹤",
"trial_feature_quotas": "管理配額",
"trial_feature_webhooks": "設定自訂 Webhook",
"trial_feature_whitelabel": "完全白標問卷調查",

View File

@@ -38,7 +38,6 @@ export const SelectPlanCard = ({ nextUrl, organizationId }: SelectPlanCardProps)
t("environments.settings.billing.trial_feature_collaboration"),
t("environments.settings.billing.trial_feature_webhooks"),
t("environments.settings.billing.trial_feature_api_access"),
t("environments.settings.billing.trial_feature_email_followups"),
t("environments.settings.billing.trial_feature_quotas"),
] as const;