Skip to content

Commit

Permalink
馃悰 Disabled auto-unsubscribe of members on permanent email failure events
Browse files Browse the repository at this point in the history
refs TryGhost/Product#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
  • Loading branch information
kevinansfield committed Jan 12, 2021
1 parent 92de3f3 commit 63f7f9a
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions core/server/services/email-analytics/lib/event-processor.js
Expand Up @@ -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]
Expand Down

0 comments on commit 63f7f9a

Please sign in to comment.