- Import emails from a list to a DB

- Create Template Emails
- Options Email
This commit is contained in:
Paolo Arena
2019-12-04 02:03:44 +01:00
parent f7fa0c4909
commit 6adeb32d46
19 changed files with 1061 additions and 211 deletions

View File

@@ -51,7 +51,7 @@ const DisciplineSchema = new Schema({
type: Boolean,
},
teachers: [{
type: String,
type: String,
}],
});
@@ -71,6 +71,22 @@ DisciplineSchema.statics.findAllIdApp = function (idapp) {
};
DisciplineSchema.statics.getDisciplineforNewsletter = function (idapp) {
const Discipline = this;
const query = [
{ $match: { $and: [{ idapp }, { showinnewsletter: true }] } },
{ $sort: { order: 1 } }
];
return Discipline
.aggregate(query)
.then((arrrec) => {
return arrrec
})
};
DisciplineSchema.statics.getFieldsForSearch = function () {
return ['label', 'description']