- Iscrizione Conacreis
- Ordini - Carrello
This commit is contained in:
@@ -189,12 +189,43 @@ module.exports = {
|
||||
|
||||
await telegrambot.notifyToTelegram(telegrambot.phase.REGISTRATION, mylocalsconf);
|
||||
|
||||
tools.sendNotifToAdmin('Nuova Registrazione Utente: ' . name + ' ' + surname + ' (' + username + ')');
|
||||
tools.sendNotifToAdmin('Nuova Registrazione Utente: ' + mylocalsconf.name + ' ' + mylocalsconf.surname + ' (' + mylocalsconf.username + ')');
|
||||
|
||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||
this.sendEmail_base('admin/registration/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||
}
|
||||
},
|
||||
sendEmail_IscrizioneConacreis: async function (lang, emailto, iscritto, idapp) {
|
||||
|
||||
// console.log('idapp', idapp, tools.getNomeAppByIdApp(idapp));
|
||||
|
||||
let mylocalsconf = {
|
||||
idapp,
|
||||
dataemail: await this.getdataemail(idapp),
|
||||
locale: lang,
|
||||
nomeapp: tools.getNomeAppByIdApp(idapp),
|
||||
strlinksito: tools.getHostByIdApp(idapp),
|
||||
username: iscritto.username,
|
||||
name: iscritto.name,
|
||||
surname: iscritto.surname,
|
||||
emailto: emailto,
|
||||
iscritto,
|
||||
};
|
||||
|
||||
this.sendEmail_base('iscrizione_conacreis/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
||||
|
||||
// Send to the Admin an Email
|
||||
this.sendEmail_base('admin/iscrizione_conacreis/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||
|
||||
await telegrambot.notifyIscrizioneToTelegram(telegrambot.phase.ISCRIZIONE_CONACREIS, mylocalsconf);
|
||||
|
||||
tools.sendNotifToAdmin('Iscrizione Conacreis : ' + mylocalsconf.name + ' ' + mylocalsconf.surname);
|
||||
|
||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||
this.sendEmail_base('admin/iscrizione_conacreis/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||
}
|
||||
},
|
||||
|
||||
sendEmail_RequestNewPassword: async function (lang, user, emailto, idapp, tokenforgot) {
|
||||
|
||||
let mylocalsconf = {
|
||||
@@ -218,6 +249,7 @@ module.exports = {
|
||||
tools.mylog('sendEmail_Booking');
|
||||
tools.mylog('tools.getNomeAppByIdApp(idapp)', tools.getNomeAppByIdApp(idapp), idapp);
|
||||
|
||||
|
||||
let mylocalsconf = {
|
||||
idapp,
|
||||
dataemail: await this.getdataemail(idapp),
|
||||
@@ -229,40 +261,72 @@ module.exports = {
|
||||
participants: '',
|
||||
participantsLunch: '',
|
||||
participantsDinner: '',
|
||||
participantsDinnerShared: '',
|
||||
msgbooking: tools.convertTexttoHtml(recbooking.msgbooking),
|
||||
eventtextplain: tools.removeSpecialCharForEmail(recbooking.infoevent),
|
||||
event: recbooking.infoevent,
|
||||
};
|
||||
|
||||
return Settings.getValDbSettings(idapp, 'MSG_REPLY_AFTER_BOOKING').then((ris => {
|
||||
mylocalsconf.msgreply_after_booking = ris;
|
||||
return Settings.getValDbSettings(idapp, 'MSG_REPLY_AFTER_BOOKING')
|
||||
.then(async (ris) => {
|
||||
mylocalsconf.msgreply_after_booking = ris;
|
||||
|
||||
if (recbooking.numpeople > 0)
|
||||
mylocalsconf.participants = recbooking.numpeople.toString() + ' ' + tools.getres__('partecipanti', res);
|
||||
mylocalsconf = await this.preparaConfPerBooking(res, idapp, mylocalsconf, recbooking, 'Prenotazione');
|
||||
|
||||
if (recbooking.numpeopleLunch > 0)
|
||||
mylocalsconf.participantsLunch = recbooking.numpeopleLunch.toString() + ' ' + tools.getres__('partecipanti a Pranzo', res);
|
||||
if (recbooking.modified) {
|
||||
texthtml = 'modifybooking';
|
||||
} else {
|
||||
texthtml = 'makebooking';
|
||||
}
|
||||
|
||||
if (recbooking.numpeopleDinner > 0)
|
||||
mylocalsconf.participantsDinner = recbooking.numpeopleDinner.toString() + ' ' + tools.getres__('partecipanti a Cena', res);
|
||||
this.sendEmail_base('booking/' + texthtml + '/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
||||
|
||||
let texthtml = '';
|
||||
if (recbooking.modified) {
|
||||
texthtml = 'modifybooking';
|
||||
} else {
|
||||
texthtml = 'makebooking';
|
||||
}
|
||||
// Send Email also to the Admin
|
||||
this.sendEmail_base('admin/' + texthtml + '/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||
|
||||
this.sendEmail_base('booking/' + texthtml + '/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||
this.sendEmail_base('admin/' + texthtml + '/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||
}
|
||||
|
||||
// Send Email also to the Admin
|
||||
this.sendEmail_base('admin/' + texthtml + '/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||
});
|
||||
|
||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||
this.sendEmail_base('admin/' + texthtml + '/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||
}
|
||||
},
|
||||
|
||||
}));
|
||||
preparaConfPerBooking: async function (res, idapp, mylocalsconf, recbooking, title) {
|
||||
|
||||
let texthtml = '';
|
||||
let msgtelegram = title + ' Evento [' + mylocalsconf.name + ' ' + mylocalsconf.surname + '] ' + mylocalsconf.eventtextplain;
|
||||
if (recbooking.modified) {
|
||||
msgtelegram += ' (modificato) '
|
||||
} else {
|
||||
msgtelegram += ' (Nuovo)'
|
||||
}
|
||||
|
||||
msgtelegram += '\n';
|
||||
|
||||
if (recbooking.numpeople > 0) {
|
||||
mylocalsconf.participants = recbooking.numpeople.toString() + ' ' + tools.getres__('partecipanti', res);
|
||||
msgtelegram += mylocalsconf.participants + '\n'
|
||||
}
|
||||
|
||||
if (recbooking.numpeopleLunch > 0) {
|
||||
mylocalsconf.participantsLunch = recbooking.numpeopleLunch.toString() + ' ' + tools.getres__('partecipanti a Pranzo', res);
|
||||
msgtelegram += mylocalsconf.participantsLunch + '\n'
|
||||
}
|
||||
|
||||
if (recbooking.numpeopleDinner > 0) {
|
||||
mylocalsconf.participantsDinner = recbooking.numpeopleDinner.toString() + ' ' + tools.getres__('partecipanti a Cena', res);
|
||||
msgtelegram += mylocalsconf.participantsDinner + '\n'
|
||||
}
|
||||
|
||||
if (recbooking.numpeopleDinnerShared > 0) {
|
||||
mylocalsconf.participantsDinnerShared = recbooking.numpeopleDinnerShared.toString() + ' ' + tools.getres__('partecipanti a Cena Condivisa', res);
|
||||
msgtelegram += mylocalsconf.participantsDinnerShared + '\n'
|
||||
}
|
||||
|
||||
telegrambot.sendMsgTelegramToTheManagers(idapp, msgtelegram);
|
||||
|
||||
return mylocalsconf;
|
||||
|
||||
},
|
||||
|
||||
@@ -282,17 +346,15 @@ module.exports = {
|
||||
participants: '',
|
||||
participantsLunch: '',
|
||||
participantsDinner: '',
|
||||
participantsDinnerShared: '',
|
||||
eventtextplain: tools.removeSpecialCharForEmail(recbooking.infoevent),
|
||||
};
|
||||
|
||||
if (recbooking.numpeople > 1)
|
||||
mylocalsconf.participants = recbooking.numpeople.toString() + ' ' + tools.getres__('partecipanti', res);
|
||||
mylocalsconf = await this.preparaConfPerBooking(res, idapp, mylocalsconf, recbooking, 'Cancellazione');
|
||||
|
||||
if (recbooking.numpeopleLunch > 1)
|
||||
mylocalsconf.participantsLunch = recbooking.numpeopleLunch.toString() + ' ' + tools.getres__('partecipanti a Pranzo', res);
|
||||
let msgtelegram = 'Cancellazione Evento [' + mylocalsconf.name + ' ' + mylocalsconf.surname + '] ' + mylocalsconf.eventtextplain;
|
||||
|
||||
if (recbooking.numpeopleDinner > 1)
|
||||
mylocalsconf.participantsDinner = recbooking.numpeopleDinner.toString() + ' ' + tools.getres__('partecipanti a Cena', res);
|
||||
telegrambot.sendMsgTelegramToTheManagers(idapp, msgtelegram);
|
||||
|
||||
this.sendEmail_base('booking/cancelbooking/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
||||
|
||||
@@ -524,7 +586,7 @@ module.exports = {
|
||||
host: mylocalsconf.dataemail.email_service,
|
||||
port: mylocalsconf.dataemail.email_port,
|
||||
secureConnection: false,
|
||||
tls: {cipher:'SSLv3'},
|
||||
tls: { cipher: 'SSLv3' },
|
||||
auth: {
|
||||
user: mylocalsconf.dataemail.from,
|
||||
pass: mylocalsconf.dataemail.pwd_from
|
||||
@@ -556,7 +618,7 @@ module.exports = {
|
||||
|
||||
sendEmail_OrderProduct: async function (lang, idapp, orders, user) {
|
||||
|
||||
const msginizio = 'INIZIO - sendEmail_OrderProduct: ' + tools.getNomeAppByIdApp(idapp);
|
||||
const msginizio = 'Ordine n: ' + orders.numorder + ' ' + user.name + ' ' + user.surname + ' [' + tools.getNomeAppByIdApp(idapp) + ']';
|
||||
console.log(msginizio);
|
||||
|
||||
await telegrambot.sendMsgTelegramToTheManagers(idapp, msginizio);
|
||||
@@ -581,9 +643,41 @@ module.exports = {
|
||||
|
||||
const esito = this.sendEmail_base('ecommerce/makeorder/' + lang, mylocalsconf.emailto, mylocalsconf, mylocalsconf.dataemail.email_reply);
|
||||
|
||||
this.sendEmail_base('ecommerce/makeorder/' + lang, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||
|
||||
},
|
||||
sendEmail_Order: async function (lang, idapp, orders, user, ordertype) {
|
||||
|
||||
const msginizio = 'INIZIO - sendEmail_Order ' + ordertype + ': ' + tools.getNomeAppByIdApp(idapp);
|
||||
console.log(msginizio);
|
||||
|
||||
await telegrambot.sendMsgTelegramToTheManagers(idapp, msginizio);
|
||||
|
||||
mylocalsconf = {
|
||||
idapp,
|
||||
locale: lang,
|
||||
nomeapp: tools.getNomeAppByIdApp(idapp),
|
||||
orders,
|
||||
baseurl: tools.getHostByIdApp(idapp),
|
||||
dataemail: await this.getdataemail(idapp),
|
||||
ordernumber: orders.numorder,
|
||||
user
|
||||
};
|
||||
|
||||
mylocalsconf.name = user.name;
|
||||
mylocalsconf.surname = user.surname;
|
||||
mylocalsconf.emailto = user.email;
|
||||
mylocalsconf.hashemail = tools.getHash(user.email);
|
||||
|
||||
mylocalsconf = this.replacefields(mylocalsconf);
|
||||
|
||||
const esito = this.sendEmail_base('ecommerce/' + ordertype + '/' + lang, mylocalsconf.emailto, mylocalsconf, mylocalsconf.dataemail.email_reply);
|
||||
|
||||
this.sendEmail_base('ecommerce/' + ordertype + '/' + lang, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||
|
||||
},
|
||||
|
||||
sendEmail_Newsletter_Events: async function (lang, idapp, id_newstosent) {
|
||||
sendEmail_Newsletter_Events: async function (lang, idapp, id_newstosent) {
|
||||
|
||||
const msginizio = 'INIZIO - sendEmail_Newsletter_Events: ' + tools.getNomeAppByIdApp(idapp);
|
||||
console.log(msginizio);
|
||||
|
||||
Reference in New Issue
Block a user