Ghost/core/server/apps/subscribers/index.js
Sebastian Gierlinger 01ae7ae49f Subscribers: Model, API & CSV import/export
- subscriber model
- subscriber app updates
- subscriber end points
- import/export CSV
- added headers to export file
- added dynamic email field detection for import
- returns stats object after CSV import
- mask error message from DB
2016-05-11 10:28:10 +02:00

24 lines
825 B
JavaScript

var _ = require('lodash'),
path = require('path'),
config = require('../../config'),
router = require('./lib/router'),
// Dirty require
template = require('../../helpers/template');
module.exports = {
activate: function activate(ghost) {
// Correct way to register a helper from an app
ghost.helpers.register('form_subscribe', function formSubscribeHelper(options) {
var data = _.merge({}, options.hash, {
action: path.join('/', config.paths.subdir, config.routeKeywords.subscribe, '/')
});
return template.execute('form_subscribe', data, options);
});
},
setupRoutes: function setupRoutes(blogRouter) {
blogRouter.use('/' + config.routeKeywords.subscribe + '/', router);
}
};