- Import emails from a list to a DB
- Create Template Emails - Options Email
This commit is contained in:
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user