🐛 Disabled auto-unsubscribe of members on permanent email failure events

refs https://github.com/TryGhost/Team/issues/446

Mailgun permanent failure events do not always correspond to unsubscribe-level events as originally thought, meaning some members could be unsubscribed unexpectedly due to delivery hiccups.

- disabled auto-unsubscribe on permanent failure events in the analytics event processor
- list maintenance will be added back in the future via alternative means
This commit is contained in:
Kevin Ansfield 2021-01-12 18:40:03 +00:00
parent 92de3f342a
commit 63f7f9a827
1 changed files with 0 additions and 12 deletions

View File

@ -109,18 +109,6 @@ class EmailAnalyticsEventProcessor {
failed_at: this.db.knex.raw('COALESCE(failed_at, ?)', [moment.utc(event.timestamp).format('YYYY-MM-DD HH:mm:ss')])
});
// saving via bookshelf triggers label fetch/update which errors and slows down processing
await this.db.knex('members')
.where('id', '=', this.db.knex('email_recipients')
.select('member_id')
.where('email_id', '=', emailId)
.where('member_email', '=', event.recipientEmail)
)
.update({
subscribed: false,
updated_at: moment.utc().toDate()
});
return {
failed: 1,
emailIds: [emailId]