- Send email when new subscriber to the newsletter
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
@@ -34,6 +34,9 @@ var UserSchema = new mongoose.Schema({
|
||||
message: '{VALUE} is not a valid email'
|
||||
}*/
|
||||
},
|
||||
cell: {
|
||||
type: String,
|
||||
},
|
||||
idapp: {
|
||||
type: String,
|
||||
required: true,
|
||||
@@ -359,7 +362,7 @@ UserSchema.statics.getUsersListByParams = function (params) {
|
||||
*/
|
||||
|
||||
UserSchema.statics.getFieldsForSearch = function () {
|
||||
return ['name', 'surname', 'email']
|
||||
return ['name', 'surname', 'email', 'cell']
|
||||
};
|
||||
|
||||
UserSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
|
||||
Reference in New Issue
Block a user