- Send email when new subscriber to the newsletter

This commit is contained in:
Paolo Arena
2019-11-01 19:59:31 +01:00
parent 93ccc73517
commit f787fd3cea
8 changed files with 92 additions and 22 deletions

View File

@@ -19,16 +19,35 @@ const OperatorSchema = new Schema({
username: {
type: String,
},
name: {
type: String,
trim: true,
},
surname: {
type: String,
trim: true,
},
email: {
type: String,
trim: true,
},
cell: {
type: String,
},
webpage: {
type: String,
trim: true,
},
img: {
type: String,
},
skype: {
qualification: { // President, Vice-President, ecc...
type: String,
},
disciplines: {
type: String,
},
certifications: {
type: String,
},
webpage: {
type: String,
},
days_working: {
@@ -37,15 +56,26 @@ const OperatorSchema = new Schema({
facebook: {
type: String,
},
disciplines: {
info: {
type: String,
},
intro: {
type: String,
},
offers: {
type: String,
},
skype: {
type: String,
},
});
OperatorSchema.statics.getFieldsForSearch = function () {
return ['name', 'surname', 'email', 'cell']
};
OperatorSchema.statics.executeQueryTable = function (idapp, params) {
params.fieldsearch = this.getFieldsForSearch();
return tools.executeQueryTable(this, idapp, params);
};
@@ -54,6 +84,9 @@ OperatorSchema.statics.findAllIdApp = function (idapp) {
const myfind = { idapp };
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
return Operator.find(myfind, (err, arrrec) => {
return arrrec
});