2022-04-07 08:30:00 +05:30
|
|
|
const NewslettersService = require('./service.js');
|
2022-04-22 13:20:44 +01:00
|
|
|
const SingleUseTokenProvider = require('../members/SingleUseTokenProvider');
|
|
|
|
const mail = require('../mail');
|
|
|
|
const models = require('../../models');
|
|
|
|
const urlUtils = require('../../../shared/url-utils');
|
2022-04-27 17:44:16 +01:00
|
|
|
const limitService = require('../limits');
|
2022-04-07 08:30:00 +05:30
|
|
|
|
2022-04-22 13:20:44 +01:00
|
|
|
const MAGIC_LINK_TOKEN_VALIDITY = 24 * 60 * 60 * 1000;
|
2022-04-07 08:30:00 +05:30
|
|
|
|
2022-04-22 13:20:44 +01:00
|
|
|
module.exports = new NewslettersService({
|
|
|
|
NewsletterModel: models.Newsletter,
|
2022-04-25 21:07:46 +01:00
|
|
|
MemberModel: models.Member,
|
2022-04-22 13:20:44 +01:00
|
|
|
mail,
|
|
|
|
singleUseTokenProvider: new SingleUseTokenProvider(models.SingleUseToken, MAGIC_LINK_TOKEN_VALIDITY),
|
2022-04-27 17:44:16 +01:00
|
|
|
urlUtils,
|
|
|
|
limitService
|
2022-04-22 13:20:44 +01:00
|
|
|
});
|