From d4a196fcbca01d9c5ff8e63189917b0ae2805cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Alby?= Date: Mon, 25 Apr 2022 13:05:44 +0200 Subject: [PATCH] Merge pull request #7712 from overleaf/jpa-email-copy-changes [web] make copy changes to trial onboarding email GitOrigin-RevId: 027ba8d471c0cac56dff7c56135d091a96817cf3 --- .../Subscription/RecurlyEventHandler.js | 2 +- .../Subscription/SubscriptionEmailBuilder.js | 45 ++++++++++++------- .../Subscription/SubscriptionEmailHandler.js | 9 +++- .../SubscriptionEmailHandlerTests.js | 17 ++++++- 4 files changed, 54 insertions(+), 19 deletions(-) diff --git a/services/web/app/src/Features/Subscription/RecurlyEventHandler.js b/services/web/app/src/Features/Subscription/RecurlyEventHandler.js index c226c9fc87..973438aed7 100644 --- a/services/web/app/src/Features/Subscription/RecurlyEventHandler.js +++ b/services/web/app/src/Features/Subscription/RecurlyEventHandler.js @@ -66,7 +66,7 @@ async function _sendSubscriptionStartedEvent(userId, eventData) { ) if (isTrial) { - await SubscriptionEmailHandler.sendTrialOnboardingEmail(userId) + await SubscriptionEmailHandler.sendTrialOnboardingEmail(userId, planCode) } } diff --git a/services/web/app/src/Features/Subscription/SubscriptionEmailBuilder.js b/services/web/app/src/Features/Subscription/SubscriptionEmailBuilder.js index de26e2ffd5..75a1fd8a55 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionEmailBuilder.js +++ b/services/web/app/src/Features/Subscription/SubscriptionEmailBuilder.js @@ -3,11 +3,11 @@ const EmailMessageHelper = require('../Email/EmailMessageHelper') const settings = require('@overleaf/settings') EmailBuilder.templates.trialOnboarding = EmailBuilder.NoCTAEmailTemplate({ - subject() { - return `Welcome to your ${settings.appName} Premium Features Trial` + subject(opts) { + return `Welcome to your Overleaf ${opts.planName} plan trial` }, - title() { - return `Welcome to your Overleaf Premium Features Trial` + title(opts) { + return `Welcome to your Overleaf ${opts.planName} plan trial` }, greeting() { return 'Hello,' @@ -102,39 +102,52 @@ EmailBuilder.templates.trialOnboarding = EmailBuilder.NoCTAEmailTemplate({ isPlainText ) + const canInviteMoreNamedCollaborators = + opts.features.collaborators === -1 || + opts.features.collaborators > settings.defaultFeatures.collaborators + + let n = 1 return [ `Welcome to your Overleaf Premium Features Trial! We really appreciate your support of Overleaf and are excited for you to use our premium features and get the most out of your trial.`, `During your trial period, be sure to check out these premium features: `, - `1. Invite more collaborators: You can now invite named collaborators to your project via the ‘share’ menu in your project (with read-only or edit access). Simply add their email address and an email invitation will be sent to them. You can remove these named collaborators at any time via the same ‘share’ menu.`, - ``, + ...(canInviteMoreNamedCollaborators + ? [ + `${n++}. Invite more collaborators: You can now invite named collaborators to your project via the ‘share’ menu in your project (with read-only or edit access). Simply add their email address and an email invitation will be sent to them. You can remove these named collaborators at any time via the same ‘share’ menu.`, + ``, + ] + : []), - `2. Increased compile timeout: You now have more time for compilation (to generate a PDF of your document) before receiving a timeout error message.`, + `${n++}. Increased compile timeout: You now have more time for compilation (to generate a PDF of your document) before receiving a timeout error message.`, ``, - `3. Real-time track changes: The track changes mode lets you see exactly what has been changed by your collaborators, and allows you to accept or reject each individual change. `, - ``, + ...(opts.features.trackChanges + ? [ + `${n++}. Real-time track changes: The track changes mode lets you see exactly what has been changed by your collaborators, and allows you to accept or reject each individual change. `, + ``, + ] + : []), - `4. Full document history and versioning: View the entire history of your project with the ability to revert to previous versions of your document from your project history (versus only 24 hours of history availability on a free Overleaf account). No more fear of losing work or making changes you can’t undo. `, + `${n++}. Full document history and versioning: View the entire history of your project with the ability to revert to previous versions of your document from your project history (versus only 24 hours of history availability on a free Overleaf account). No more fear of losing work or making changes you can’t undo. `, ``, - `5. Advanced reference search: You can search by citation key, and our premium feature allows the added ability to search by author, title, year, or journal.`, + `${n++}. Advanced reference search: You can search by citation key, and our premium feature allows the added ability to search by author, title, year, or journal.`, ``, - `6. Reference manager sync : You can link your Mendeley and Zotero accounts to your Overleaf account, allowing you to import your reference library and keep your Overleaf document in sync with the references stored in Mendeley / Zotero.`, + `${n++}. Reference manager sync : You can link your Mendeley and Zotero accounts to your Overleaf account, allowing you to import your reference library and keep your Overleaf document in sync with the references stored in Mendeley / Zotero.`, ``, - `7. Dropbox Sync: You can link your Dropbox account to your Overleaf account, allowing 2-way integration with Dropbox `, + `${n++}. Dropbox Sync: You can link your Dropbox account to your Overleaf account, allowing 2-way integration with Dropbox `, ``, - `8. Git and GitHub integration: You can configure your Overleaf project to sync directly with a repository on GitHub, or you can use raw git access. This allows you to work offline and sync your files whenever you come back online. You can also use our Overleaf Git Bridge integration, which lets you git clone, push and pull changes between the online Overleaf editor, and your local offline git repository.`, + `${n++}. Git and GitHub integration: You can configure your Overleaf project to sync directly with a repository on GitHub, or you can use raw git access. This allows you to work offline and sync your files whenever you come back online. You can also use our Overleaf Git Bridge integration, which lets you git clone, push and pull changes between the online Overleaf editor, and your local offline git repository.`, ``, - `9. Symbol Palette: A quick and convenient tool to insert math symbols into your document.`, + `${n++}. Symbol Palette: A quick and convenient tool to insert math symbols into your document.`, ``, - `10. Online tutorials and knowledge base: We have an extensive online knowledge base providing a wide range of platform guidance, LaTeX tutorials, technical articles, and webinars.`, + `${n++}. Online tutorials and knowledge base: We have an extensive online knowledge base providing a wide range of platform guidance, LaTeX tutorials, technical articles, and webinars.`, `