mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added content gating to the mega service
no-issue
This commit is contained in:
parent
15ffae211d
commit
84300747a9
1 changed files with 4 additions and 2 deletions
|
@ -8,8 +8,10 @@ const postEmailSerializer = require('./post-email-serializer');
|
||||||
const sendEmail = async (post) => {
|
const sendEmail = async (post) => {
|
||||||
const emailTmpl = postEmailSerializer.serialize(post);
|
const emailTmpl = postEmailSerializer.serialize(post);
|
||||||
|
|
||||||
const {members} = await membersService.api.members.list();
|
const {members} = await membersService.api.members.list({limit: 'all'});
|
||||||
const emails = members.map(m => m.email);
|
const emails = members.filter((member) => {
|
||||||
|
return membersService.contentGating.checkPostAccess(post, member);
|
||||||
|
}).map(m => m.email);
|
||||||
|
|
||||||
return bulkEmailService.send(emailTmpl, emails);
|
return bulkEmailService.send(emailTmpl, emails);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue