mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 10:10:08 +02:00
Merge pull request #17856 from overleaf/rh-deletion-email-update
[web] Use securityAlert template for user deletion email GitOrigin-RevId: 60dfef18946710f5d5df17daca1a0bdc9800519b
This commit is contained in:
@@ -786,31 +786,6 @@ templates.userOnboardingEmail = NoCTAEmailTemplate({
|
||||
},
|
||||
})
|
||||
|
||||
templates.deletedAccount = NoCTAEmailTemplate({
|
||||
subject() {
|
||||
return 'Overleaf security note: account deletion confirmation'
|
||||
},
|
||||
title() {
|
||||
return 'Account deleted'
|
||||
},
|
||||
message(opts, isPlainText) {
|
||||
const dateFormatted = moment().format('dddd D MMMM YYYY')
|
||||
const timeFormatted = moment().format('HH:mm')
|
||||
const helpLink = EmailMessageHelper.displayLink(
|
||||
'quick guide',
|
||||
`${settings.siteUrl}/learn/how-to/Keeping_your_account_secure`,
|
||||
isPlainText
|
||||
)
|
||||
|
||||
return [
|
||||
`We are writing to let you know that your ${settings.appName} account was deleted on ${dateFormatted} at ${timeFormatted} GMT.`,
|
||||
`If this was you, you're all set and can ignore this email.`,
|
||||
`If you did not take this action, please get in touch with our support team at ${settings.adminEmail} to report this as potentially suspicious activity on your account.`,
|
||||
`For tips on keeping your ${settings.appName} account secure, read our ${helpLink}.`,
|
||||
]
|
||||
},
|
||||
})
|
||||
|
||||
templates.securityAlert = NoCTAEmailTemplate({
|
||||
subject(opts) {
|
||||
return `Overleaf security note: ${opts.action}`
|
||||
|
||||
@@ -115,8 +115,10 @@ async function ensureCanDeleteUser(user) {
|
||||
async function _sendDeleteEmail(user) {
|
||||
const emailOptions = {
|
||||
to: user.email,
|
||||
action: 'account deleted',
|
||||
actionDescribed: 'your Overleaf account was deleted',
|
||||
}
|
||||
await EmailHandler.promises.sendEmail('deletedAccount', emailOptions)
|
||||
await EmailHandler.promises.sendEmail('securityAlert', emailOptions)
|
||||
}
|
||||
|
||||
async function _createDeletedUser(user, options) {
|
||||
|
||||
@@ -263,10 +263,12 @@ describe('UserDeleter', function () {
|
||||
await this.UserDeleter.promises.deleteUser(this.userId, {})
|
||||
const emailOptions = {
|
||||
to: 'bob@bob.com',
|
||||
action: 'account deleted',
|
||||
actionDescribed: 'your Overleaf account was deleted',
|
||||
}
|
||||
expect(
|
||||
this.EmailHandler.promises.sendEmail
|
||||
).to.have.been.calledWith('deletedAccount', emailOptions)
|
||||
).to.have.been.calledWith('securityAlert', emailOptions)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user