When someone complains about an email from the platform we get a callback from SES.

A new platform admin page Email complaints has been added to surface those complaints.
Eventually the complaints will be visible to the services so they can remove the email address from their mailing list.

Next thing to implement is "x email complaints" warning on the platform admin summary page.
This commit is contained in:
Rebecca Law
2018-06-06 15:22:48 +01:00
parent 217cf9abd4
commit 84445d154d
8 changed files with 108 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ from datetime import datetime
from flask import render_template, request
from flask_login import login_required
from app import service_api_client
from app import complaint_api_client, service_api_client
from app.main import main
from app.main.forms import DateFilterForm
from app.statistics_utils import get_formatted_percentage
@@ -70,6 +70,18 @@ def platform_admin_services():
)
@main.route("/platform-admin/complaints")
@login_required
@user_is_platform_admin
def platform_admin_list_complaints():
complaints = complaint_api_client.get_all_complaints()
return render_template(
'views/platform-admin/complaints.html',
complaints=complaints,
page_title='All Complaints',
)
def sum_service_usage(service):
total = 0
for notification_type in service['statistics'].keys():