mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
refs https://github.com/TryGhost/Team/issues/1469 Currently, all new members get auto subscribed to the default newsletter. This change adds same behavior with multiple newsletters by auto subscribing all available newsletters on site for new members(If flag is enabled). Note: In future, this will also take into consideration the `subscribe_on_signup` flag for a newsletter to filter which newsletters should a member be auto-subscribed. - adds newsletters service for working with newsletter data - bumps `@tryghost/members-api` package which handles default subscription - adds new test fixture/data for newsletters
24 lines
489 B
JavaScript
24 lines
489 B
JavaScript
class NewslettersService {
|
|
/**
|
|
*
|
|
* @param {Object} options
|
|
* @param {Object} options.NewsletterModel
|
|
*/
|
|
constructor({NewsletterModel}) {
|
|
this.NewsletterModel = NewsletterModel;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @param {Object} options browse options
|
|
* @returns
|
|
*/
|
|
async browse(options) {
|
|
let newsletters = await this.NewsletterModel.findAll(options);
|
|
|
|
return newsletters.toJSON();
|
|
}
|
|
}
|
|
|
|
module.exports = NewslettersService;
|
|
|