From 4eaa0e55ad3567e0df5716594853af16bd2505bf Mon Sep 17 00:00:00 2001 From: Mackenzie Halliday Date: Tue, 10 Dec 2024 18:38:56 -0500 Subject: [PATCH 1/7] 2082 - Update API Docs for Bulleted List in Emails --- documents/openapi/openapi.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/documents/openapi/openapi.yaml b/documents/openapi/openapi.yaml index 82cb3a330a..d6356a630f 100644 --- a/documents/openapi/openapi.yaml +++ b/documents/openapi/openapi.yaml @@ -1117,6 +1117,30 @@ paths: * `reference` - A string to indicate any reference * `scheduled_for` - A datetime indicated when to send the notification (not available at this time) + ### Advanced usage + + * `personlisation` + The `personalisation` object allows for passing variables to populate the template. + + - Keys represent variable names in the template. + - Values can be strings or lists. + - If a value is a list, it will be rendered as a bulleted list in the email. + + Example: + + ```json + { + "personalisation": { + "full_name": "John Smith", + "list_example": [ + "item 1", + "item 2", + "item 3" + ] + } + } + ``` + security: - serviceAuth: [] tags: From 0272e048086f036952dd310b2ec534c581750381 Mon Sep 17 00:00:00 2001 From: Mackenzie Halliday Date: Tue, 10 Dec 2024 18:42:32 -0500 Subject: [PATCH 2/7] Squash 2082 - Correct formatting for advance usage and example --- documents/openapi/openapi.yaml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/documents/openapi/openapi.yaml b/documents/openapi/openapi.yaml index d6356a630f..3aa9bbafb1 100644 --- a/documents/openapi/openapi.yaml +++ b/documents/openapi/openapi.yaml @@ -1119,27 +1119,28 @@ paths: ### Advanced usage - * `personlisation` - The `personalisation` object allows for passing variables to populate the template. + * `personalisation` + + The `personalisation` properties allows for passing variables to populate the template. - Keys represent variable names in the template. - Values can be strings or lists. - If a value is a list, it will be rendered as a bulleted list in the email. - Example: + Example: - ```json - { - "personalisation": { - "full_name": "John Smith", - "list_example": [ - "item 1", - "item 2", - "item 3" - ] + ```json + { + "personalisation": { + "full_name": "John Smith", + "list_example": [ + "item 1", + "item 2", + "item 3" + ] + } } - } - ``` + ``` security: - serviceAuth: [] From 1ddc6812279e334243509e03ce04678cb0dccdea Mon Sep 17 00:00:00 2001 From: Mackenzie Halliday Date: Tue, 10 Dec 2024 18:44:59 -0500 Subject: [PATCH 3/7] Squash 2082 - Update version number --- documents/openapi/openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/openapi/openapi.yaml b/documents/openapi/openapi.yaml index 3aa9bbafb1..0e4963c1b6 100644 --- a/documents/openapi/openapi.yaml +++ b/documents/openapi/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: VA Notify API Documentation - version: 1.0.9 + version: 1.0.10 description: |

This documents the API schemas for consumption by internal VA developers.

Authorization header

From a000df82ca81893dab8639286fffc0bffe404cd2 Mon Sep 17 00:00:00 2001 From: Mackenzie Halliday Date: Tue, 10 Dec 2024 18:46:18 -0500 Subject: [PATCH 4/7] Squash 2082 - Update example in api --- documents/openapi/openapi.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/documents/openapi/openapi.yaml b/documents/openapi/openapi.yaml index 0e4963c1b6..427399c0b0 100644 --- a/documents/openapi/openapi.yaml +++ b/documents/openapi/openapi.yaml @@ -1159,6 +1159,10 @@ paths: email_address: test@notification.com personalisation: full_name: John Smith + tasks: + - "Task 1" + - "Task 2" + - "Task 3" claim_id: '123456' billing_code: string callback_url: https://staging-api.va.gov/vanotify/internal/swagger From 8bb033c31f3120428f57e85d74655642a6098a99 Mon Sep 17 00:00:00 2001 From: Mackenzie Halliday Date: Tue, 10 Dec 2024 18:49:25 -0500 Subject: [PATCH 5/7] Squash 2082 - Update examples in notification email post --- documents/openapi/openapi.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/documents/openapi/openapi.yaml b/documents/openapi/openapi.yaml index 427399c0b0..bc2ab21039 100644 --- a/documents/openapi/openapi.yaml +++ b/documents/openapi/openapi.yaml @@ -1159,11 +1159,11 @@ paths: email_address: test@notification.com personalisation: full_name: John Smith + claim_id: '123456' tasks: - "Task 1" - "Task 2" - "Task 3" - claim_id: '123456' billing_code: string callback_url: https://staging-api.va.gov/vanotify/internal/swagger email_reply_to_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 @@ -1178,6 +1178,10 @@ paths: personalisation: full_name: John Smith claim_id: '123456' + tasks: + - "Task 1" + - "Task 2" + - "Task 3" billing_code: string callback_url: https://staging-api.va.gov/vanotify/internal/swagger email_reply_to_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 From eb9c0dbd7989539c0c13b11d783582e71c057aa2 Mon Sep 17 00:00:00 2001 From: Mackenzie Halliday Date: Tue, 10 Dec 2024 18:52:53 -0500 Subject: [PATCH 6/7] Squash 2082 - clairification around template --- documents/openapi/openapi.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documents/openapi/openapi.yaml b/documents/openapi/openapi.yaml index bc2ab21039..5f49fad7bb 100644 --- a/documents/openapi/openapi.yaml +++ b/documents/openapi/openapi.yaml @@ -1121,9 +1121,9 @@ paths: * `personalisation` - The `personalisation` properties allows for passing variables to populate the template. + The `personalisation` properties allows for passing variables to populate the notification template. - - Keys represent variable names in the template. + - Keys represent variable names in the notification template. - Values can be strings or lists. - If a value is a list, it will be rendered as a bulleted list in the email. From 93b24c6ba6dd5b1425d85cb5c14b608e8ae4b6f6 Mon Sep 17 00:00:00 2001 From: Mackenzie Halliday Date: Wed, 11 Dec 2024 11:46:53 -0500 Subject: [PATCH 7/7] Squash 2082 - Correction after standup --- .talismanrc | 2 ++ documents/openapi/openapi.yaml | 43 ++++++++++++++-------------------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/.talismanrc b/.talismanrc index 7cc6a35d36..025f84a201 100644 --- a/.talismanrc +++ b/.talismanrc @@ -47,6 +47,8 @@ fileignoreconfig: checksum: 2c4024d4e94ffa39ff73e6039d65f0b1d19557067ddf6d97ef14aea86cfb58ad - filename: ci/docker-compose-test.yml checksum: e3efec2749e8c19e60f5bfc68eafabe24eba647530a482ceccfc4e0e62cff424 +- filename: documents/openapi/openapi.yaml + checksum: f67b71f8506be867a206e8f4605c1bbc7a3b13c9d18ce6aa5317b4cbed4a50aa - filename: lambda_functions/pinpoint_callback/pinpoint_callback_lambda.py checksum: 7bd4900e14b1fa789bbb2568b8a8d7a400e3c8350ba32fb44cc0b5b66a2df037 - filename: lambda_functions/ses_callback/ses_callback_lambda.py diff --git a/documents/openapi/openapi.yaml b/documents/openapi/openapi.yaml index 5f49fad7bb..316598f58e 100644 --- a/documents/openapi/openapi.yaml +++ b/documents/openapi/openapi.yaml @@ -1113,33 +1113,18 @@ paths: * `billing_code` - A string to indicate your billing code * `callback_url` - An https URL; note that this overrides any service level callback * `email_reply_to_id` - A UUID - * `personalisation` - If the template includes personalisation, the fields to populate (see examples) + * `personalisation` - A JSON object containing the fields needed to populate the notification template. See **Advanced Usage** section and **dynamic bullet list** example for details. * `reference` - A string to indicate any reference * `scheduled_for` - A datetime indicated when to send the notification (not available at this time) ### Advanced usage - * `personalisation` - - The `personalisation` properties allows for passing variables to populate the notification template. - - - Keys represent variable names in the notification template. - - Values can be strings or lists. - - If a value is a list, it will be rendered as a bulleted list in the email. - - Example: + The `personalisation` JSON object allows for dynamic customization of the notification template by passing variables: - ```json - { - "personalisation": { - "full_name": "John Smith", - "list_example": [ - "item 1", - "item 2", - "item 3" - ] - } - } + - **Keys**: Represent variable names defined in the notification template. + - **Values**: Specify the data to replace the variables. Values can be: + - **Strings**: Used for simple text replacement. + - **Lists**: Rendered as bulleted lists in the email notification. ``` security: @@ -1160,10 +1145,6 @@ paths: personalisation: full_name: John Smith claim_id: '123456' - tasks: - - "Task 1" - - "Task 2" - - "Task 3" billing_code: string callback_url: https://staging-api.va.gov/vanotify/internal/swagger email_reply_to_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 @@ -1175,6 +1156,18 @@ paths: recipient_identifier: id_type: ICN id_value: 1000000000V000000 + personalisation: + full_name: John Smith + claim_id: '123456' + billing_code: string + callback_url: https://staging-api.va.gov/vanotify/internal/swagger + email_reply_to_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + reference: string + scheduled_for: string + dynamic bulleted list: + value: + template_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + email_address: test@notification.com personalisation: full_name: John Smith claim_id: '123456'