mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-01 02:41:39 -05:00
Added periodic "emails" limit check when (re)sending a newsletter
refs https://github.com/TryGhost/Team/issues/588
refs d72ba77aba
- When limit is in place we don't want to allow sending out a new batch of emails if it would go over limit
- See referenced commit for example configuration
This commit is contained in:
parent
d72ba77aba
commit
fc458efa90
1 changed files with 4 additions and 0 deletions
|
@ -140,6 +140,10 @@ const addEmail = async (postModel, options) => {
|
|||
return null;
|
||||
}
|
||||
|
||||
if (limitService.isLimited('emails')) {
|
||||
await limitService.errorIfWouldGoOverLimit('emails', {addedCount: membersCount});
|
||||
}
|
||||
|
||||
const postId = postModel.get('id');
|
||||
const existing = await models.Email.findOne({post_id: postId}, knexOptions);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue