diff --git a/app/main/views/notifications.py b/app/main/views/notifications.py index c501eb0b1..20d309a21 100644 --- a/app/main/views/notifications.py +++ b/app/main/views/notifications.py @@ -10,6 +10,7 @@ from flask_login import login_required from app import ( notification_api_client, + job_api_client, current_service ) from app.main import main @@ -57,11 +58,16 @@ def view_notification(service_id, notification_id): show_recipient=True, ) template.values = notification['personalisation'] + if notification['job']: + job = job_api_client.get_job(service_id, notification['job']['id'])['data'] + else: + job = None return render_template( 'views/notifications/notification.html', finished=(notification['status'] in (DELIVERED_STATUSES + FAILURE_STATUSES)), uploaded_file_name='Report', template=template, + job=job, updates_url=url_for( ".view_notification_updates", service_id=service_id, diff --git a/app/templates/views/notifications/notification.html b/app/templates/views/notifications/notification.html index e077877fa..274776b22 100644 --- a/app/templates/views/notifications/notification.html +++ b/app/templates/views/notifications/notification.html @@ -15,7 +15,14 @@

- Sent {% if created_by %}by {{ created_by.name }} {% endif %} + {{ template.name }} + sent + {% if job %} + from + {{ job.original_file_name }} + {% elif created_by %} + by {{ created_by.name }} + {% endif %} on {{ created_at|format_datetime_short }}

@@ -23,9 +30,4 @@ {{ ajax_block(partials, updates_url, 'status', finished=finished) }} - {{ page_footer( - secondary_link=url_for('.view_template', service_id=current_service.id, template_id=template.id), - secondary_link_text='Back to {}'.format(template.name) - ) }} - {% endblock %}