Add contact block to serialize template for v2

This attribute has been requested by a user, and we have not been
serializing it so far.
This commit is contained in:
Pea Tyczynska
2020-07-09 18:10:03 +01:00
parent 40f747d8ef
commit f6f88750b5
3 changed files with 12 additions and 2 deletions

View File

@@ -182,6 +182,7 @@ def create_template(
folder=None,
postage=None,
process_type='normal',
contact_block_id=None
):
data = {
'name': template_name or '{} Template Name'.format(template_type),
@@ -192,10 +193,12 @@ def create_template(
'reply_to': reply_to,
'hidden': hidden,
'folder': folder,
'process_type': process_type
'process_type': process_type,
}
if template_type == LETTER_TYPE:
data["postage"] = postage or "second"
if contact_block_id:
data['service_letter_contact_id'] = contact_block_id
if template_type != SMS_TYPE:
data['subject'] = subject
template = Template(**data)