- Requirements
- Send Msg to Passeggeri
This commit is contained in:
Paolo Arena
2020-03-10 21:44:14 +01:00
parent 26715cda44
commit fbc85ce06a
37 changed files with 2392 additions and 673 deletions

View File

@@ -496,7 +496,7 @@ module.exports = {
const msginizio = 'INIZIO - sendEmail_Newsletter_Events: ' + tools.getNomeAppByIdApp(idapp);
console.log(msginizio);
telegrambot.sendMsgTelegramToTheManagers(idapp, msginizio);
await telegrambot.sendMsgTelegramToTheManagers(idapp, msginizio);
//++Todo Extract List Email to send
const userstosend = await MailingList.findAllIdAppSubscribed(idapp);
@@ -539,7 +539,7 @@ module.exports = {
if (!activate) {
// Invio Newsletter Abortito!
mynewsrec.error_job = 'Invio Newsletter abortito alle ore ' + new Date().toDateString() + new Date().toTimeString();
telegrambot.sendMsgTelegramToTheManagers(idapp, mynewsrec.error_job);
await telegrambot.sendMsgTelegramToTheManagers(idapp, mynewsrec.error_job);
await mynewsrec.save();
await Newstosent.processingJob(id_newstosent, false);
console.log('*** L\'Invio della Newsletter è stato fermato ! ');
@@ -567,7 +567,7 @@ module.exports = {
if ((mynewsrec.numemail_sent % 50) === 0) {
const msgproc = 'In Corso ' + mynewsrec.numemail_sent + ' / ' + mynewsrec.numemail_tot + ' Email inviate...';
telegrambot.sendMsgTelegramToTheManagers(idapp, msgproc);
await telegrambot.sendMsgTelegramToTheManagers(idapp, msgproc);
}
//Put the result in the database, to check if is sent or not.
@@ -591,7 +591,7 @@ module.exports = {
} catch (e) {
const msgerr = 'Error LOOP sendEmail_Newsletter_Events: ' + e;
console.error(msgerr);
telegrambot.sendMsgTelegramToTheManagers(idapp, msgerr);
await telegrambot.sendMsgTelegramToTheManagers(idapp, msgerr);
}
}
@@ -601,7 +601,7 @@ module.exports = {
msgfine += mynewsrec.numemail_sent + ' Email inviate';
console.log(msgfine);
telegrambot.sendMsgTelegramToTheManagers(idapp, msgfine);
await telegrambot.sendMsgTelegramToTheManagers(idapp, msgfine);
} catch (e) {
@@ -610,7 +610,7 @@ module.exports = {
if (!activate) {
// Invio Newsletter Abortito!
mynewsrec.error_job = 'Invio Newsletter abortito alle ore ' + new Date().toDateString() + new Date().toTimeString();
telegrambot.sendMsgTelegramToTheManagers(idapp, mynewsrec.error_job);
await telegrambot.sendMsgTelegramToTheManagers(idapp, mynewsrec.error_job);
await mynewsrec.save();
await Newstosent.processingJob(id_newstosent, false);
console.log('*** L\'Invio della Newsletter è stato fermato ! ');