Ghost/core/server/models/email-recipient.js
2020-10-14 15:11:45 +01:00

26 lines
665 B
JavaScript

const ghostBookshelf = require('./base');
const EmailRecipient = ghostBookshelf.Model.extend({
tableName: 'email_recipients',
hasTimestamps: false,
email() {
return this.belongsTo('Email', 'email_id');
},
emailBatch() {
return this.belongsTo('EmailBatch', 'batch_id');
},
member() {
return this.belongsTo('Member', 'member_id');
}
});
const EmailRecipients = ghostBookshelf.Collection.extend({
model: EmailRecipient
});
module.exports = {
EmailRecipient: ghostBookshelf.model('EmailRecipient', EmailRecipient),
EmailRecipients: ghostBookshelf.collection('EmailRecipients', EmailRecipients)
};