From 06e2a14de5d519ea6ac38dbf7a1c0bed026ddcf3 Mon Sep 17 00:00:00 2001 From: Paul Huliganga Date: Tue, 24 Mar 2026 10:58:37 -0400 Subject: [PATCH] feat: update email intro text; allow up to 5 copies of Authorization to Release form; update flows and docs --- .../docs/DEPLOYMENT_AND_TESTING.md | 2 +- composite-envelope-builder/docs/design.md | 4 ++-- .../docs/requirements.md | 8 ++++---- .../DocusignCompositeEnvelopeBuilder.cls | 4 ++-- ...ocusign_Envelope_Templates_V3.flow-meta.xml | 18 ++++++++++++++++++ ...ocusign_Envelope_Templates_V4.flow-meta.xml | 18 ++++++++++++++++++ 6 files changed, 45 insertions(+), 9 deletions(-) diff --git a/composite-envelope-builder/docs/DEPLOYMENT_AND_TESTING.md b/composite-envelope-builder/docs/DEPLOYMENT_AND_TESTING.md index 5ea0ea5..6abe83e 100644 --- a/composite-envelope-builder/docs/DEPLOYMENT_AND_TESTING.md +++ b/composite-envelope-builder/docs/DEPLOYMENT_AND_TESTING.md @@ -364,7 +364,7 @@ After successful deployment, configure your Salesforce org: - **Error Message** — Error details if creation failed 5. Save and test the flow -> **Multi-copy dialog**: If you are using `Docusign_Envelope_Templates_V3`, the flow automatically detects when "Authorization to Release Information" is selected and displays a radio-button screen asking for 1, 2, or 3 copies before sending. No additional Flow configuration is required for this feature. +> **Multi-copy dialog**: If you are using `Docusign_Envelope_Templates_V3`, the flow automatically detects when "Authorization to Release Information" is selected and displays a radio-button screen asking for 1–5 copies before sending. No additional Flow configuration is required for this feature. --- diff --git a/composite-envelope-builder/docs/design.md b/composite-envelope-builder/docs/design.md index 16eaea8..c3cd7ef 100644 --- a/composite-envelope-builder/docs/design.md +++ b/composite-envelope-builder/docs/design.md @@ -276,7 +276,7 @@ The following new elements were added to `Docusign_Envelope_Templates_V3`: | `Does_Row_Contain_Auth_Release` | Decision | Checks if the current row's `Name` contains `"Authorization to Release Information"` | | `Flag_Auth_Release_Selected` | Assignment | Sets `authReleaseTemplateSelected = true` when match is found | | `Is_Auth_Release_Selected` | Decision | After scan loop: routes to copies screen if flag is true, otherwise skips | -| `Authorization_Copies_Screen` | Screen | Shows instruction text + radio buttons (1 copy / 2 copies / 3 copies) | +| `Authorization_Copies_Screen` | Screen | Shows instruction text + radio buttons (1–5 copies) | | `authReleaseFormCopies` | Variable (Number, default 1) | Stores the user's copy-count selection | | `authReleaseTemplateSelected` | Variable (Boolean, default false) | Flag set during the scan loop | | `AuthCopies_1/2/3` | Choices | Radio button options with numeric values 1 / 2 / 3 | @@ -328,7 +328,7 @@ if (copies > 1) { } ``` -Duplicate template IDs are intentionally **not deduplicated** when multi-copy is in effect. The label builder appends `" (Copy 2)"` / `" (Copy 3)"` suffixes to keep document labels distinct within the envelope. +Duplicate template IDs are intentionally **not deduplicated** when multi-copy is in effect. The label builder appends `" (Copy 2)"` / `" (Copy 3)"` / `" (Copy 4)"` / `" (Copy 5)"` suffixes to keep document labels distinct within the envelope. --- diff --git a/composite-envelope-builder/docs/requirements.md b/composite-envelope-builder/docs/requirements.md index c457acf..108674d 100644 --- a/composite-envelope-builder/docs/requirements.md +++ b/composite-envelope-builder/docs/requirements.md @@ -46,11 +46,11 @@ Replace combination templates with **28 single-form templates** (14 forms × 2 l #### FR-006: Multiple Copies of Authorization to Release Information **Priority**: Medium -**Description**: When the "Authorization to Release Information" template (English or Spanish) is selected, users may include 1, 2, or 3 copies of that form in the same envelope +**Description**: When the "Authorization to Release Information" template (English or Spanish) is selected, users may include 1, 2, 3, 4, or 5 copies of that form in the same envelope **Acceptance Criteria**: - After template selection, if "Authorization to Release Information" is among the selected templates, an additional dialog screen is displayed before sending -- The dialog presents a radio-button selection: **1 copy** (default), **2 copies**, **3 copies** -- If the user selects 2 or 3 copies, the template is added to the envelope that many times, each appearing as a distinct document +- The dialog presents a radio-button selection: **1 copy** (default), **2 copies**, **3 copies**, **4 copies**, **5 copies** +- If the user selects more than 1 copy, the template is added to the envelope that many times (up to 5), each appearing as a distinct document - Additional copies are labelled with a `(Copy N)` suffix in the envelope document list so they are distinguishable - If "Authorization to Release Information" is not selected, the dialog is skipped entirely and default behaviour is unchanged - The template name used for matching is stored in a single constant (`MULTI_COPY_TEMPLATE_NAME`) in the Apex class and a single string value in the Flow decision, making it straightforward to update if the template is renamed @@ -236,7 +236,7 @@ Replace combination templates with **28 single-form templates** (14 forms × 2 l - Given I have selected the "Authorization to Release Information" template (English or Spanish) along with any other forms - When I click "Send" on the template selection screen - Then a new dialog appears asking "How many copies of this form should be included in the envelope?" -- And the dialog offers radio-button options: 1 copy (pre-selected), 2 copies, 3 copies +-- And the dialog offers radio-button options: 1 copy (pre-selected), 2 copies, 3 copies, 4 copies, 5 copies - When I select 2 copies and click "Next" - Then the resulting envelope contains 2 copies of the Authorization form plus all other selected forms - And I see the standard success confirmation after sending diff --git a/composite-envelope-builder/force-app/main/default/classes/DocusignCompositeEnvelopeBuilder.cls b/composite-envelope-builder/force-app/main/default/classes/DocusignCompositeEnvelopeBuilder.cls index a669b9b..abd3df0 100644 --- a/composite-envelope-builder/force-app/main/default/classes/DocusignCompositeEnvelopeBuilder.cls +++ b/composite-envelope-builder/force-app/main/default/classes/DocusignCompositeEnvelopeBuilder.cls @@ -70,7 +70,7 @@ global with sharing class DocusignCompositeEnvelopeBuilder { // the list now so the deduplication step handles all IDs uniformly. List expandedTemplateIds = new List(req.templateIds); Integer copies = (req.authReleaseFormCopies != null && req.authReleaseFormCopies > 1) - ? Math.min(req.authReleaseFormCopies, 3) + ? Math.min(req.authReleaseFormCopies, 5) : 1; if (copies > 1) { // Find which template ID(s) correspond to the multi-copy template @@ -232,7 +232,7 @@ global with sharing class DocusignCompositeEnvelopeBuilder { } // Compose body: greeting → template bodies separated by a visual divider → sign-off String DIVIDER = '\n\n' + '─'.repeat(40) + '\n\n'; - String GREETING = 'Hello,\n\n'; + String GREETING = 'Hello,\n\nPlease complete the DocuSign signature request from Early Intervention Colorado.\n\n'; String SIGNOFF = '\n\nThank you,\nEarly Intervention Colorado'; String envelopeBody; if (bodyParts.isEmpty()) { diff --git a/composite-envelope-builder/force-app/main/default/flows/Docusign_Envelope_Templates_V3.flow-meta.xml b/composite-envelope-builder/force-app/main/default/flows/Docusign_Envelope_Templates_V3.flow-meta.xml index 7df9fdc..fb71e5a 100644 --- a/composite-envelope-builder/force-app/main/default/flows/Docusign_Envelope_Templates_V3.flow-meta.xml +++ b/composite-envelope-builder/force-app/main/default/flows/Docusign_Envelope_Templates_V3.flow-meta.xml @@ -427,6 +427,8 @@ AuthCopies_1 AuthCopies_2 AuthCopies_3 + AuthCopies_4 + AuthCopies_5 Number AuthCopies_1 Number of Copies @@ -660,4 +662,20 @@ 3.0 + + AuthCopies_4 + 4 copies + Number + + 4.0 + + + + AuthCopies_5 + 5 copies + Number + + 5.0 + + diff --git a/composite-envelope-builder/force-app/main/default/flows/Docusign_Envelope_Templates_V4.flow-meta.xml b/composite-envelope-builder/force-app/main/default/flows/Docusign_Envelope_Templates_V4.flow-meta.xml index c9b18c6..1637b90 100644 --- a/composite-envelope-builder/force-app/main/default/flows/Docusign_Envelope_Templates_V4.flow-meta.xml +++ b/composite-envelope-builder/force-app/main/default/flows/Docusign_Envelope_Templates_V4.flow-meta.xml @@ -533,6 +533,8 @@ AuthCopies_1 AuthCopies_2 AuthCopies_3 + AuthCopies_4 + AuthCopies_5 Number AuthCopies_1 Number of Copies @@ -773,4 +775,20 @@ 3.0 + + AuthCopies_4 + 4 copies + Number + + 4.0 + + + + AuthCopies_5 + 5 copies + Number + + 5.0 + +