- Import emails from a list to a DB
- Create Template Emails - Options Email
This commit is contained in:
@@ -30,6 +30,13 @@ const SettingsSchema = new Schema({
|
||||
},
|
||||
value_num: {
|
||||
type: Number,
|
||||
},
|
||||
value_bool: {
|
||||
type: Boolean,
|
||||
},
|
||||
serv: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
@@ -45,12 +52,14 @@ SettingsSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
SettingsSchema.statics.getValDbSettings = function (idapp, key) {
|
||||
return Settings.findOne({ idapp, key })
|
||||
.then((myrec) => {
|
||||
console.log('getValDbSettings', myrec, 'idapp', idapp);
|
||||
// console.log('getValDbSettings', myrec, 'idapp', idapp);
|
||||
if (myrec) {
|
||||
if (myrec.type === tools.FieldType.date)
|
||||
return myrec.value_date;
|
||||
if (myrec.type === tools.FieldType.number)
|
||||
else if (myrec.type === tools.FieldType.number)
|
||||
return myrec.value_num;
|
||||
else if (myrec.type === tools.FieldType.boolean)
|
||||
return myrec.value_bool;
|
||||
else
|
||||
return myrec.value_str;
|
||||
} else {
|
||||
@@ -64,10 +73,10 @@ SettingsSchema.statics.getValDbSettings = function (idapp, key) {
|
||||
|
||||
};
|
||||
|
||||
SettingsSchema.statics.findAllIdApp = function (idapp) {
|
||||
SettingsSchema.statics.findAllIdApp = function (idapp, serv) {
|
||||
const Settings = this;
|
||||
|
||||
const myfind = { idapp };
|
||||
const myfind = { idapp, serv };
|
||||
|
||||
return Settings.find(myfind, (err, arrrec) => {
|
||||
return arrrec
|
||||
|
||||
Reference in New Issue
Block a user