فهرست منبع

Merge pull request #31099 from overleaf/ii-domain-capture-member-limit-email

[web] Members limit email template changes

GitOrigin-RevId: 8c26adda9f748a22a2c99787a3166be706293de3
Jessica Lawshe 8 ماه پیش
والد
کامیت
487ffc2309
2فایلهای تغییر یافته به همراه25 افزوده شده و 22 حذف شده
  1. 13 11
      services/web/app/src/Features/Email/EmailBuilder.mjs
  2. 12 11
      services/web/test/unit/src/Email/EmailBuilder.test.mjs

+ 13 - 11
services/web/app/src/Features/Email/EmailBuilder.mjs

@@ -1025,24 +1025,26 @@ templates.taxExemptCertificateRequired = NoCTAEmailTemplate({
 
 
 templates.groupMemberLimitWarning = ctaTemplate({
 templates.groupMemberLimitWarning = ctaTemplate({
   subject(opts) {
   subject(opts) {
-    return `${opts.groupName || 'Your group'} is approaching its member limit`
+    return `Action needed: Your Overleaf group is nearly out of licenses`
   },
   },
   title(opts) {
   title(opts) {
-    return `${opts.groupName || 'Your group'} is approaching its member limit`
+    return `Action needed: Your Overleaf group is nearly out of licenses`
   },
   },
   greeting(opts) {
   greeting(opts) {
-    return opts.firstName ? `Hi ${opts.firstName},` : 'Hi,'
+    return opts.firstName ? `Hi ${opts.firstName},` : 'Hi there,'
   },
   },
   message(opts) {
   message(opts) {
     return [
     return [
-      `Your group "${opts.groupName}" is approaching its member limit.`,
-      `<b>Current usage:</b> ${opts.currentMembers} of ${opts.membersLimit} licenses used (${opts.remainingSeats} remaining)`,
-      'With domain capture enabled, users with verified email addresses from your domain can automatically join the group via SSO. Once the member limit is reached, new users will be blocked from joining.',
-    ]
-  },
-  secondaryMessage() {
-    return [
-      'To ensure uninterrupted access for your users, consider adding more licenses or removing inactive members.',
+      `Your Overleaf group <b>${opts.groupName}</b> is close to its license limit.`,
+      `<b>${opts.currentMembers} of ${opts.membersLimit} licenses are in use (${opts.remainingSeats} remaining).</b>`,
+      'Because domain capture is enabled, users from your domain can join automatically via SSO.' +
+        '<br/>' +
+        '<b>Once all licenses are used, new users won’t be able to join.</b>',
+      '<b>What you can do now:</b>',
+      '<ul>' +
+        '<li>Add more licenses, or</li>' +
+        '<li>Remove inactive users to free up licenses</li>' +
+        '</ul>',
     ]
     ]
   },
   },
   ctaText() {
   ctaText() {

+ 12 - 11
services/web/test/unit/src/Email/EmailBuilder.test.mjs

@@ -1005,26 +1005,27 @@ describe('EmailBuilder', function () {
             const dom = cheerio.load(ctx.email.html)
             const dom = cheerio.load(ctx.email.html)
             const plainText = dom.text()
             const plainText = dom.text()
             expect(ctx.email.subject).to.equal(
             expect(ctx.email.subject).to.equal(
-              `${ctx.opts.groupName} is approaching its member limit`
+              'Action needed: Your Overleaf group is nearly out of licenses'
             )
             )
             expect(ctx.email.html).to.exist
             expect(ctx.email.html).to.exist
             expect(ctx.email.html).to.contain(
             expect(ctx.email.html).to.contain(
-              `Your group "${ctx.opts.groupName}" is approaching its member limit.`
+              `Your Overleaf group <b>${ctx.opts.groupName}</b> is close to its license limit.`
             )
             )
             expect(plainText).to.contain(
             expect(plainText).to.contain(
-              `Current usage: ${ctx.opts.currentMembers} of ` +
-                `${ctx.opts.membersLimit} licenses used ` +
-                `(${ctx.opts.remainingSeats} remaining)`
+              `${ctx.opts.currentMembers} of ${ctx.opts.membersLimit} ` +
+                `licenses are in use (${ctx.opts.remainingSeats} remaining).`
             )
             )
             expect(ctx.email.html).to.contain(
             expect(ctx.email.html).to.contain(
-              'With domain capture enabled, users with verified email ' +
-                'addresses from your domain can automatically join the group ' +
-                'via SSO. Once the member limit is reached, new users will ' +
-                'be blocked from joining.'
+              'Because domain capture is enabled, users from your domain ' +
+                'can join automatically via SSO.'
             )
             )
             expect(ctx.email.html).to.contain(
             expect(ctx.email.html).to.contain(
-              'To ensure uninterrupted access for your users, consider ' +
-                'adding more licenses or removing inactive members.'
+              'Once all licenses are used, new users won’t be able to join.'
+            )
+            expect(ctx.email.html).to.contain('What you can do now:')
+            expect(ctx.email.html).to.contain('Add more licenses, or')
+            expect(ctx.email.html).to.contain(
+              'Remove inactive users to free up licenses'
             )
             )
             const buttonLink = dom('td a')
             const buttonLink = dom('td a')
             expect(buttonLink).to.exist
             expect(buttonLink).to.exist