Repository navigation
Win back Cloud trials a day after expiry; test a €5.99 first month for private users - #958
Merged
Merged
Conversation
Exact, case-insensitive match against free mailbox providers (Gmail, GMX, web.de, Outlook, iCloud...), to tell private users from businesses.
LicenseService.subscriptionHistory posts up to 20 addresses per call to /api/license/subscription-history with the service token. It returns null on any error or incomplete answer, so callers can send nothing and retry. Addresses are never logged.
The first win-back (30% off, or the how-to without calls) now goes out 1 to 7 days after the trial ends instead of 7 to 14, under the same flag key trial_email_winback7. The copy dates the trial instead of saying it ended a week ago. No discount goes to a workspace with any non-trial licence, in any state (paid, card trial, revoked), and each recipient is checked against the licence site's Stripe subscription history; if the site cannot answer, nothing is sent and the stage stays open. Consumer workspaces (all admins on free mailboxes, no business connector, Vinted excepted) that used the product are split 50/50 by a hash of the workspace id: Cloud Starter for €5.99 the first month (WINBACK_CONSUMER_PROMO_CODE, default STARTER599) or START30 as control. The arm is stored in OrgSettings winback_test_arm and counted in the cron log. Cloud only: CloudModule is not loaded on self-hosted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cloud win-back changes asked by Matteo on 8 Oct: the first win-back goes out the day after a trial ends instead of a week later, nobody who has or had a Stripe subscription or card trial gets a discount, and a 50/50 test of "Cloud Starter for €5.99 the first month" against START30 for private users.
Deploy order: the licence site's
POST /api/license/subscription-history(website PR) must be live first. Until it answers, discount win-backs are postponed to the next hourly run without being flagged, so nothing wrong goes out, but a workspace still unanswered past day 7 misses its first offer.Changes
trial_email_winback7, so nothing is sent twice. Second stage (WINBACK50, 30–37 days) unchanged. Copy says "ended on 7 October" instead of "a week ago" / "last week".trial, in any status (paid, card trialtrialing, revoked unpaid card trial, ...) is skipped and the stage flagged. Before, only active non-trial licences were checked.LicenseService.subscriptionHistory(emails)asks the licence site, with the service token, whether each recipient ever had an AnythingMCP Stripe subscription. Those recipients are dropped. Any failure or incomplete answer: nothing sent, nothing flagged, retried next run. Logs carry the workspace id, never an address.src/common/consumer-email-domains.ts), and no business connector. "Business" = a catalog connector in e-commerce, CRM, accounting, ERP, payments, logistics, finance, HR, support, ITSM, wholesale, advertising, marketing automation, field service, construction, DMS, time tracking, e-signature or banking. Vinted is the exception, since its sellers are private people; Etsy sellers on Gmail are small businesses.first_month_599(codeWINBACK_CONSUMER_PROMO_CODE, defaultSTARTER599), odd →start30_control. Stored in OrgSettingswinback_test_armonce the email is sent; non-eligible workspaces keep START30 with no arm.winbackFirstMonthandwinbackControl.firstMonthemail: "Your first month of AnythingMCP Cloud for €5.99", then €19/month, cancel anytime from the billing portal; discount win-backs are the agreed exception to the no-price-talk rule. Admin preview samples renamed towinback-discount-first,-first-month,-final,winback-help.ee/cloud/onboarding-cron.service.tsis edited on purpose: the Cloud win-back lives there (owner's decision for this change).Cloud and self-hosted
Cloud only:
CloudModuleis loaded only withDEPLOYMENT_MODE=cloud. Self-hosted trials keep the licence site's own emails, unchanged.Type
Testing
Timing window edges (0.5 d nothing, 1.2 d and 6.9 d sent, 7.1 d nothing), any non-trial licence skipped and flagged, site says true → recipient skipped, site error → nothing sent and not flagged, consumer workspace without business connector → arm by hash with the right offer and arm stored, e-commerce connector → START30 without arm, Vinted still eligible, company admin → START30, second stage unchanged, old flag respected.
In
packages/backend:npm run lint--fixrewrites reverted)npx tsc --noEmit -p tsconfig.jsonnpm test -- --silentRelated Issues
None (internal growth experiment).