Implement premium features discoverability on successful subscription page with split test (#8336)

GitOrigin-RevId: 362fa289fa6e009e316dcaceae0587f5fc18162c
This commit is contained in:
M Fahru 2022-06-17 07:55:05 -04:00 committed by Copybot
parent 2970a09d19
commit c54c048e35
4 changed files with 16 additions and 1 deletions

View file

@ -307,12 +307,23 @@ async function successfulSubscription(req, res) {
user
)
const premiumFeaturesDiscoverabilityAssignment =
await SplitTestHandler.promises.getAssignment(
req,
res,
'premium-features-discoverability'
)
const premiumFeaturesDiscoverability =
premiumFeaturesDiscoverabilityAssignment?.variant === 'active'
if (!personalSubscription) {
res.redirect('/user/subscription/plans')
} else {
res.render('subscriptions/successful_subscription', {
title: 'thank_you',
personalSubscription,
premiumFeaturesDiscoverability,
})
}
}

View file

@ -20,6 +20,8 @@ block content
a.btn.btn-success.btn-large(href=`/manage/groups/${personalSubscription._id}/members`) #{translate("add_your_first_group_member_now")}
p.letter-from-founders
p #{translate("thanks_for_subscribing_you_help_sl", {planName:personalSubscription.plan.name})}
if premiumFeaturesDiscoverability
p !{translate("to_get_the_most_of_sub_check_premium_features", {}, [{name: 'a', attrs: {href: 'https://www.overleaf.com/learn/how-to/Overleaf_premium_features'}}])}
p #{translate("need_anything_contact_us_at")}
a(href=`mailto:${settings.adminEmail}`, ng-non-bindable) #{settings.adminEmail}
| .

View file

@ -1774,5 +1774,6 @@
"group_plan_with_name_tooltip": "You are on the __plan__ plan as a member of a group subscription, __groupName__. Click to find out how you could benefit from Overleaf premium features!",
"commons_plan_tooltip": "Youre on the __plan__ plan because of your affiliation with __institution__. Click to find out how you could benefit from Overleaf premium features!",
"trial_last_day": "This is the last day of your <b>Overleaf Premium</b> trial",
"trial_remaining_days": "__days__ more days on your <b>Overleaf Premium</b> trial"
"trial_remaining_days": "__days__ more days on your <b>Overleaf Premium</b> trial",
"to_get_the_most_of_sub_check_premium_features": "To get the most out of your subscription, check out the list of <0>__appName__s premium features</0>"
}

View file

@ -403,6 +403,7 @@ describe('SubscriptionController', function () {
assert.deepEqual(variables, {
title: 'thank_you',
personalSubscription: 'foo',
premiumFeaturesDiscoverability: false,
})
done()
}