mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 04:41:32 +02:00
Merge pull request #22371 from overleaf/ii-remove-sales-contact-form-from-subscription-group-controller
[web] Add seats sales contact GitOrigin-RevId: a1c5826cc775aa51f201e6cc30a1b2a4dda7ee2b
This commit is contained in:
@@ -10,7 +10,6 @@ import { expressify } from '@overleaf/promise-utils'
|
||||
import Modules from '../../infrastructure/Modules.js'
|
||||
import SplitTestHandler from '../SplitTests/SplitTestHandler.js'
|
||||
import ErrorController from '../Errors/ErrorController.js'
|
||||
import SalesContactFormController from '../../../../modules/cms/app/src/controllers/SalesContactFormController.mjs'
|
||||
import UserGetter from '../User/UserGetter.js'
|
||||
import { Subscription } from '../../models/Subscription.js'
|
||||
|
||||
@@ -192,19 +191,24 @@ async function submitForm(req, res) {
|
||||
const userEmail = await UserGetter.promises.getUserEmail(userId)
|
||||
const { adding } = req.body
|
||||
|
||||
req.body = {
|
||||
const messageLines = [`\n**Overleaf Sales Contact Form:**`]
|
||||
messageLines.push('**Subject:** Self-Serve Group User Increase Request')
|
||||
messageLines.push(`**Estimated Number of Users:** ${adding}`)
|
||||
messageLines.push(
|
||||
`**Message:** This email has been generated on behalf of user with email **${userEmail}** ` +
|
||||
'to request an increase in the total number of users for their subscription.'
|
||||
)
|
||||
const messageFormatted = messageLines.join('\n\n')
|
||||
|
||||
const data = {
|
||||
email: userEmail,
|
||||
subject: 'Self-Serve Group User Increase Request',
|
||||
estimatedNumberOfUsers: adding,
|
||||
message:
|
||||
`This email has been generated on behalf of user with email **${userEmail}** ` +
|
||||
'to request an increase in the total number of users ' +
|
||||
`for their subscription.\n\n` +
|
||||
`The requested number of users to add is: ${adding}`,
|
||||
subject: 'Sales Contact Form',
|
||||
message: messageFormatted,
|
||||
inbox: 'sales',
|
||||
}
|
||||
|
||||
return SalesContactFormController.submitForm(req, res)
|
||||
await Modules.promises.hooks.fire('sendSupportRequest', data)
|
||||
res.sendStatus(204)
|
||||
}
|
||||
|
||||
async function flexibleLicensingSplitTest(req, res, next) {
|
||||
|
||||
Reference in New Issue
Block a user