- Add Button Whatsapp Chat
- Fixed 'Ask Info' and 'Book' if the email arrived... - Added "Settings" table: URL_FACEBOOK, TELEGRAM_SUPPORT, URL_INSTAGRAM, WHATSAPP_CELL, INT_CODE, MAIN_EMAIL, CONTACTS_EMAIL_CELL, CALL_WORKING_DAYS, EVENTS_CAL, MSG_REPLY_AFTER_BOOKING. -
This commit is contained in:
@@ -6,6 +6,7 @@ const Email = require('email-templates');
|
||||
|
||||
var i18n = require("i18n");
|
||||
|
||||
const { Settings } = require('./models/settings');
|
||||
|
||||
const previewEmail = require('preview-email');
|
||||
const nodemailer = require("nodemailer");
|
||||
@@ -174,24 +175,29 @@ module.exports = {
|
||||
event: recbooking.infoevent,
|
||||
};
|
||||
|
||||
if (recbooking.numpeople > 1)
|
||||
mylocalsconf.participants = recbooking.numpeople.toString() + ' ' + res.__("partecipanti");
|
||||
return Settings.getValDbSettings(idapp, 'MSG_REPLY_AFTER_BOOKING').then((ris => {
|
||||
mylocalsconf.msgreply_after_booking = ris;
|
||||
|
||||
let texthtml = '';
|
||||
if (recbooking.modified) {
|
||||
texthtml = 'modifybooking';
|
||||
}else {
|
||||
texthtml = 'makebooking';
|
||||
}
|
||||
if (recbooking.numpeople > 1)
|
||||
mylocalsconf.participants = recbooking.numpeople.toString() + ' ' + res.__("partecipanti");
|
||||
|
||||
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+'/' + lang, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||
this.sendEmail_base('booking/'+texthtml+'/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
||||
|
||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||
this.sendEmail_base('admin/'+texthtml+'/' + lang, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||
}
|
||||
// Send Email also to the Admin
|
||||
this.sendEmail_base('admin/'+texthtml+'/' + lang, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||
|
||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||
this.sendEmail_base('admin/'+texthtml+'/' + lang, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||
}
|
||||
|
||||
}));
|
||||
|
||||
},
|
||||
|
||||
@@ -240,7 +246,13 @@ module.exports = {
|
||||
strlinkreply: tools.getHostByIdApp(idapp) + '/messages/' + recmsg._id
|
||||
};
|
||||
|
||||
return this.sendEmail_base('msg/sendmsg/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
||||
let replyto = '';
|
||||
if (mylocalsconf.infoevent !== '')
|
||||
replyto = user.email;
|
||||
else
|
||||
replyto = tools.getreplyToEmailByIdApp(idapp);
|
||||
|
||||
return this.sendEmail_base('msg/sendmsg/' + lang, emailto, mylocalsconf, replyto);
|
||||
|
||||
// Send Email also to the Admin
|
||||
// this.sendEmail_base('admin/sendmsg/' + lang, tools.getAdminEmailByIdApp(idapp), mylocalsconf);
|
||||
|
||||
Reference in New Issue
Block a user