Ghost/core/server/services/mega
Kevin Ansfield 8d5e7ed695
🐛 Fixed unsubscribed members receiving email when a post is sent to all members (#13181)
refs https://github.com/TryGhost/Team/issues/935

The problem was incorrect operator precedence when multiple statements existed in the filter original filter when we transform it to enforce `subscribed:true` before sending.

- free only - subscribed:true+status:free - no issue
- paid only - subscribed:true+status:-free - no issue
- all - subscribed:true+status:-free,status:free - the ,status:free part is treated as a separate OR statement meaning the subscribed:true is not applied to it and free members that are unsubscribed will receive the email

- extracted the filter transform into a separate function so it can be unit tested
- updated the transform to use `()` for operator precedence, eg: `subscribed:true+(status:-free,status:free)`
- used transform function in `addEmail()` and `getEmailMemberRows()`
- fixed `sent/send` typo in error message
2021-07-26 12:47:03 +01:00
..
index.js Extracted post email serializer from mega service 2019-11-05 12:15:50 +07:00
mega.js 🐛 Fixed unsubscribed members receiving email when a post is sent to all members (#13181) 2021-07-26 12:47:03 +01:00
post-email-serializer.js Render an email correctly according to the associated member segment 2021-07-01 13:36:42 +02:00
segment-parser.js Added unique filtering for segment parser 2021-06-30 17:43:28 +04:00
template.js 🐛 Fixed alt="null" for feature image in emails 2021-07-15 09:44:34 +01:00