diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 79773fd083..28494c29a4 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -1541,6 +1541,8 @@ "thanks_for_confirming_your_email_address": "", "thanks_for_getting_in_touch": "", "thanks_for_subscribing": "", + "thanks_for_subscribing_to_plan_with_add_on": "", + "thanks_for_subscribing_to_the_add_on": "", "thanks_for_subscribing_you_help_sl": "", "thanks_settings_updated": "", "the_add_on_will_remain_active_until": "", diff --git a/services/web/frontend/js/features/subscription/components/successful-subscription/successful-subscription.tsx b/services/web/frontend/js/features/subscription/components/successful-subscription/successful-subscription.tsx index ac85c4b90e..3c64846db0 100644 --- a/services/web/frontend/js/features/subscription/components/successful-subscription/successful-subscription.tsx +++ b/services/web/frontend/js/features/subscription/components/successful-subscription/successful-subscription.tsx @@ -7,6 +7,12 @@ import OLRow from '@/features/ui/components/ol/ol-row' import OLCol from '@/features/ui/components/ol/ol-col' import OLPageContentCard from '@/features/ui/components/ol/ol-page-content-card' import OLNotification from '@/features/ui/components/ol/ol-notification' +import { + AI_ADD_ON_CODE, + ADD_ON_NAME, + isStandaloneAiPlanCode, +} from '../../data/add-on-codes' +import { RecurlySubscription } from '../../../../../../types/subscription/dashboard/subscription' function SuccessfulSubscription() { const { t } = useTranslation() @@ -17,6 +23,8 @@ function SuccessfulSubscription() { if (!subscription || !('recurly' in subscription)) return null + const onAiStandalonePlan = isStandaloneAiPlanCode(subscription.planCode) + return (
- {t('thanks_for_subscribing_you_help_sl', { - planName: subscription.plan.name, - })} -
-{t('need_anything_contact_us_at')} @@ -79,19 +86,21 @@ function SuccessfulSubscription() { .
-
-
+
{t('regards')},
@@ -113,4 +122,45 @@ function SuccessfulSubscription() {
)
}
+function ThankYouSection({
+ subscription,
+ onAiStandalonePlan,
+}: {
+ subscription: RecurlySubscription
+ onAiStandalonePlan: boolean
+}) {
+ const { t } = useTranslation()
+ const hasAiAddon = subscription?.addOns?.some(
+ addOn => addOn.addOnCode === AI_ADD_ON_CODE
+ )
+
+ if (onAiStandalonePlan) {
+ return (
+
+ {t('thanks_for_subscribing_to_the_add_on', { + addOnName: ADD_ON_NAME, + })} +
+ ) + } + if (hasAiAddon) { + return ( ++ {t('thanks_for_subscribing_to_plan_with_add_on', { + planName: subscription.plan.name, + addOnName: ADD_ON_NAME, + })} +
+ ) + } + + return ( ++ {t('thanks_for_subscribing_you_help_sl', { + planName: subscription.plan.name, + })} +
+ ) +} + export default SuccessfulSubscription diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 4f9c8f3996..f4aab37bad 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -2140,6 +2140,8 @@ "thanks_for_confirming_your_email_address": "Thanks for confirming your email address", "thanks_for_getting_in_touch": "Thanks for getting in touch. Our team will get back to you by email as soon as possible.", "thanks_for_subscribing": "Thanks for subscribing!", + "thanks_for_subscribing_to_plan_with_add_on": "Thank you for subscribing to the __planName__ plan with the __addOnName__ add-on. It’s support from people like yourself that allows __appName__ to continue to grow and improve.", + "thanks_for_subscribing_to_the_add_on": "Thank you for subscribing to the __addOnName__ add-on. It’s support from people like yourself that allows __appName__ to continue to grow and improve.", "thanks_for_subscribing_you_help_sl": "Thank you for subscribing to the __planName__ plan. It’s support from people like yourself that allows __appName__ to continue to grow and improve.", "thanks_settings_updated": "Thanks, your settings have been updated.", "the_add_on_will_remain_active_until": "The add-on will remain active until the end of the current billing period.",