mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
🐛 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:
parent
92de3f342a
commit
63f7f9a827
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user