mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
Add preview endpoint and tests
This commit is contained in:
@@ -66,3 +66,14 @@ post_template_preview_response = {
|
||||
},
|
||||
"required": ["id", "type", "version", "body"]
|
||||
}
|
||||
|
||||
|
||||
def create_post_template_preview_response(template, body, url_root):
|
||||
return {
|
||||
"id": template.id,
|
||||
"type": template.template_type,
|
||||
"version": template.version,
|
||||
"content": {'body': body},
|
||||
"subject": template.subject,
|
||||
"uri": "{}v2/template/{}/preview".format(url_root, template.id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user