Просмотр исходного кода

Merge pull request #15963 from overleaf/ab-reminder-invite-non-managed

[web] Reminder emails for non-managed groups

GitOrigin-RevId: 93b7c0afb0b0b2057ad38a5628edc9526a0a48a5
Alexandre Bourdin 2 лет назад
Родитель
Сommit
661c9f685c

+ 4 - 4
services/web/app/src/Features/Email/EmailBuilder.js

@@ -368,12 +368,12 @@ templates.reconfirmEmail = ctaTemplate({
 
 templates.verifyEmailToJoinTeam = ctaTemplate({
   subject(opts) {
-    return `${_.escape(
+    return `${opts.reminder ? 'Reminder: ' : ''}${_.escape(
       _formatUserNameAndEmail(opts.inviter, 'A collaborator')
     )} has invited you to join a group subscription on ${settings.appName}`
   },
   title(opts) {
-    return `${_.escape(
+    return `${opts.reminder ? 'Reminder: ' : ''}${_.escape(
       _formatUserNameAndEmail(opts.inviter, 'A collaborator')
     )} has invited you to join a group subscription on ${settings.appName}`
   },
@@ -456,9 +456,9 @@ templates.inviteNewUserToJoinManagedUsers = ctaTemplate({
   },
   secondaryMessage(opts) {
     return [
-      `User accounts in this group are managed by ${_.escape(
+      `<b>User accounts in this group are managed by ${_.escape(
         _formatUserNameAndEmail(opts.admin, 'an admin')
-      )}.`,
+      )}.</b>`,
       `If you accept, the owner of the group subscription will have admin rights over your account and control over your stuff.`,
       `<b>What is ${settings.appName}?</b>`,
       `${settings.appName} is the collaborative online LaTeX editor loved by researchers and technical writers. With thousands of ready-to-use templates and an array of LaTeX learning resources you’ll be up and running in no time.`,

+ 11 - 3
services/web/app/src/Features/Subscription/TeamInvitesController.js

@@ -267,9 +267,17 @@ async function resendInvite(req, res, next) {
     await rateLimiters.resendGroupInvite.consume(userEmail)
 
     const existingUser = await UserGetter.promises.getUserByAnyEmail(userEmail)
-    const emailTemplate = existingUser
-      ? 'verifyEmailToJoinManagedUsers'
-      : 'inviteNewUserToJoinManagedUsers'
+
+    let emailTemplate
+    if (subscription.managedUsersEnabled) {
+      if (existingUser) {
+        emailTemplate = 'verifyEmailToJoinManagedUsers'
+      } else {
+        emailTemplate = 'inviteNewUserToJoinManagedUsers'
+      }
+    } else {
+      emailTemplate = 'verifyEmailToJoinTeam'
+    }
 
     EmailHandler.sendDeferredEmail(emailTemplate, opts)
   } catch (err) {