Lots bounce emails related fixes

- Show bounce score on user admin page
- Added reset bounce score button on user admin page
- Only whitelisted email types are sent to emails with high bounce score
- FIX: properly detect bounces even when there is no TO: header in the email
- Don't desactivate a user when reaching the bounce threshold
This commit is contained in:
Régis Hanol
2016-05-06 19:34:33 +02:00
parent f9fe9ac3ed
commit 1e57bbf5c8
14 changed files with 118 additions and 37 deletions

View File

@ -23,7 +23,8 @@ class Admin::UsersController < Admin::AdminController
:primary_group,
:generate_api_key,
:revoke_api_key,
:anonymize]
:anonymize,
:reset_bounce_score]
def index
users = ::AdminUserIndexQuery.new(params).find_users
@ -355,6 +356,12 @@ class Admin::UsersController < Admin::AdminController
end
end
def reset_bounce_score
guardian.ensure_can_reset_bounce_score!(@user)
@user.user_stat.update_columns(bounce_score: 0, reset_bounce_score_after: nil)
render json: success_json
end
private
def fetch_user