mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
reformat
This commit is contained in:
@@ -1,16 +1,22 @@
|
||||
|
||||
|
||||
def create_post_sms_response_from_notification(
|
||||
notification_id, client_reference, template_id, template_version, service_id,
|
||||
content, from_number, url_root
|
||||
notification_id,
|
||||
client_reference,
|
||||
template_id,
|
||||
template_version,
|
||||
service_id,
|
||||
content,
|
||||
from_number,
|
||||
url_root,
|
||||
):
|
||||
resp = __create_notification_response(
|
||||
notification_id, client_reference, template_id, template_version, service_id, url_root
|
||||
notification_id,
|
||||
client_reference,
|
||||
template_id,
|
||||
template_version,
|
||||
service_id,
|
||||
url_root,
|
||||
)
|
||||
resp['content'] = {
|
||||
'from_number': from_number,
|
||||
'body': content
|
||||
}
|
||||
resp["content"] = {"from_number": from_number, "body": content}
|
||||
return resp
|
||||
|
||||
|
||||
@@ -26,31 +32,35 @@ def create_post_email_response_from_notification(
|
||||
url_root,
|
||||
):
|
||||
resp = __create_notification_response(
|
||||
notification_id, client_reference, template_id, template_version, service_id, url_root
|
||||
notification_id,
|
||||
client_reference,
|
||||
template_id,
|
||||
template_version,
|
||||
service_id,
|
||||
url_root,
|
||||
)
|
||||
resp['content'] = {
|
||||
"from_email": email_from,
|
||||
"body": content,
|
||||
"subject": subject
|
||||
}
|
||||
resp["content"] = {"from_email": email_from, "body": content, "subject": subject}
|
||||
return resp
|
||||
|
||||
|
||||
def __create_notification_response(
|
||||
notification_id, client_reference, template_id, template_version, service_id, url_root
|
||||
notification_id,
|
||||
client_reference,
|
||||
template_id,
|
||||
template_version,
|
||||
service_id,
|
||||
url_root,
|
||||
):
|
||||
return {
|
||||
"id": notification_id,
|
||||
"reference": client_reference,
|
||||
"uri": "{}v2/notifications/{}".format(url_root, str(notification_id)),
|
||||
'template': {
|
||||
"template": {
|
||||
"id": template_id,
|
||||
"version": template_version,
|
||||
"uri": "{}services/{}/templates/{}".format(
|
||||
url_root,
|
||||
str(service_id),
|
||||
str(template_id)
|
||||
)
|
||||
url_root, str(service_id), str(template_id)
|
||||
),
|
||||
},
|
||||
"scheduled_for": None
|
||||
"scheduled_for": None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user