Merge pull request #2669 from alphagov/test-key-letters

Show if letters are sent using a test key
This commit is contained in:
Chris Hill-Scott
2019-01-22 11:36:13 +00:00
committed by GitHub
4 changed files with 107 additions and 17 deletions

View File

@@ -125,7 +125,10 @@ def view_notification(service_id, notification_id):
can_receive_inbound=(current_service.has_permission('inbound_sms')),
is_precompiled_letter=notification['template']['is_precompiled_letter'],
letter_print_day=letter_print_day,
show_cancel_button=show_cancel_button
show_cancel_button=show_cancel_button,
sent_with_test_key=(
notification.get('key_type') == KEY_TYPE_TEST
),
)

View File

@@ -16,7 +16,7 @@
<p>
{% if is_precompiled_letter %}
Provided as PDF
Provided as PDF
{% else %}
{% if help %}
{{ template.name }}
@@ -51,15 +51,30 @@
fixed the problem
</p>
{% else %}
<p>
{{ letter_print_day }}
</p>
<p>
Postage: {{ postage }} class
</p>
<p>
Estimated delivery date: {{ estimated_letter_delivery_date|string|format_date_short }}
</p>
{% if sent_with_test_key %}
<p>
Postage: {{ postage }} class
</p>
{% if is_precompiled_letter %}
<p>
This letter passed our checks, but we will not print it because you used a test key.
</p>
{% else %}
<p>
We will not print this letter because you used a test key.
</p>
{% endif %}
{% else %}
<p>
{{ letter_print_day }}
</p>
<p>
Postage: {{ postage }} class
</p>
<p>
Estimated delivery date: {{ estimated_letter_delivery_date|string|format_date_short }}
</p>
{% endif %}
{% endif %}
{% endif %}