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

[web] Reminder emails for non-managed groups

GitOrigin-RevId: 93b7c0afb0b0b2057ad38a5628edc9526a0a48a5
This commit is contained in:
Alexandre Bourdin 2023-11-27 14:41:39 +01:00 committed by Copybot
parent 4422a37ed4
commit 661c9f685c
2 changed files with 15 additions and 7 deletions

View file

@ -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 youll be up and running in no time.`,

View file

@ -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) {