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/server/cron/nps.js

22 lines
473 B

import { settings } from '../../app/settings';
import { NPS } from '../sdk';
function runNPS() {
// if NPS is disabled close any pending scheduled survey
const enabled = settings.get('NPS_survey_enabled');
if (!enabled) {
Promise.await(NPS.closeOpenSurveys());
return;
}
Promise.await(NPS.sendResults());
}
export function npsCron(SyncedCron) {
SyncedCron.add({
name: 'NPS',
schedule(parser) {
return parser.cron('9 3 * * *');
},
job: runNPS,
});
}