The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/server/cron/nps.ts

18 lines
511 B

import { NPS } from '@rocket.chat/core-services';
import { cronJobs } from '@rocket.chat/cron';
import { settings } from '../../app/settings/server';
async function runNPS(): Promise<void> {
// if NPS is disabled close any pending scheduled survey
const enabled = settings.get('NPS_survey_enabled');
if (!enabled) {
await NPS.closeOpenSurveys();
return;
}
await NPS.sendResults();
}
export async function npsCron(): Promise<void> {
await cronJobs.add('NPS', '21 15 * * *', async () => runNPS());
}