Ghost/core/frontend/services/routing/UnsubscribeRouter.js
Kevin Ansfield ee47dd4dae
Added /unsubscribe/ route to the front-end (#11394)
no issue

- adds new router to the frontend for handling unsubscribe
- default template lives in `core/server/frontend/views/unsubscribe.hbs`
- `{{error}}` is present and contains the error message when unsubscribe fails
- `{{member}}` is present and contains the member email
- updated unsubscribe url to match the new format
2019-11-15 09:36:49 +00:00

28 lines
644 B
JavaScript

const ParentRouter = require('./ParentRouter');
const controllers = require('./controllers');
/**
* @description Unsubscribe Router.
*
* "/unsubscribe/" -> Unsubscribe Router
*/
class UnsubscribeRouter extends ParentRouter {
constructor() {
super('UnsubscribeRouter');
// @NOTE: hardcoded, not configurable
this.route = {value: '/unsubscribe/'};
this._registerRoutes();
}
/**
* @description Register all routes of this router.
* @private
*/
_registerRoutes() {
this.mountRoute(this.route.value, controllers.unsubscribe);
}
}
module.exports = UnsubscribeRouter;