Allow letter templates to select the default contact block from the list

This commit is contained in:
chrisw
2018-01-03 10:44:36 +00:00
parent db2fad1a75
commit 7271d4fbde
15 changed files with 875 additions and 40 deletions

View File

@@ -100,6 +100,9 @@ def template_json(service_id,
archived=False,
process_type='normal',
redact_personalisation=None,
service_letter_contact=None,
reply_to=None,
reply_to_text=None,
):
template = {
'id': id_,
@@ -111,6 +114,9 @@ def template_json(service_id,
'updated_at': datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f'),
'archived': archived,
'process_type': process_type,
'service_letter_contact': service_letter_contact,
'reply_to': reply_to,
'reply_to_text': reply_to_text,
}
if content is None:
template['content'] = "template content"
@@ -236,6 +242,7 @@ def notification_json(
rows=5,
personalisation=None,
template_type=None,
reply_to_text=None
):
if template is None:
template = template_json(service_id, str(generate_uuid()), type_=template_type)
@@ -283,6 +290,7 @@ def notification_json(
'template_version': template['version'],
'personalisation': personalisation or {},
'notification_type': template_type,
'reply_to_text': reply_to_text,
} for i in range(rows)],
'total': rows,
'page_size': 50,