- Prepend 'Hello,' greeting before first template body
- Separate template bodies with a blank line + horizontal rule + blank line
- Append 'Thank you, / Early Intervention Colorado' after last template body
- Greeting + sign-off are included even when no templates supply a body
- Add recipientSmsPhone InvocableVariable to DocusignEnvelopeRequest
- Add SMS_PLACEHOLDER_EMAIL constant to DocusignCompositeEnvelopeBuilder
- Update resolveRecipients() and buildRecipient() to accept smsPhone param
- Chain .withSmsDelivery(smsPhone) on recipient when smsPhone is provided
- Substitute placeholder email when recipient has no email and SMS phone given
- Add Flow V4 with Get_Recipient_Contact lookup, Is_Recipient_Email_Blank
decision, and SMS_Phone_Screen to collect phone for no-email recipients
- V3 left untouched for existing Salesforce deployments
DocusignEnvelopeRequest:
- Add authReleaseFormCopies InvocableVariable (Integer, optional, 1-3)
DocusignCompositeEnvelopeBuilder:
- Add MULTI_COPY_TEMPLATE_NAME constant (single place to update if the
template is renamed; matched via LIKE '%...%' covering both languages)
- Before building the document list, query for template IDs matching the
multi-copy template name and append (copies-1) additional IDs so the
envelope contains the correct number of distinct documents
- Duplicate-safe label builder: appends '(Copy N)' suffix to keep
document labels unique within the envelope
- Build deduplicated displayNames list for email subject/body:
collapses multi-copy entries to a single line with a '(N)' count
suffix, e.g. 'Authorization to Release Information (3)'
- Email body: each template's message text is included only once even
when the same template ID appears multiple times (bodyIdsAdded guard)
- Log and Status label use displayNames (deduplicated) not raw docNames
- Updated DocusignCompositeEnvelopeBuilder.cls to sort documents and subject by Short_Name__c
- Modified Docusign_Envelope_Templates_V3.flow-meta.xml: repositioned elements and added filter for Short_Name__c not null
- Add truncation to existing working email subject logic (combined template names)
- Subject is truncated to 100 characters max with '...' suffix when needed
- Add test case for truncation with multiple templates
- Preserves existing behavior: subject = combined template names, body = concatenated email messages
- Query Short_Name__c field from dfsle__EnvelopeConfiguration__c
- Use short names for email subject (fallback to full names if blank)
- Custom emailSubject still overrides if provided
- Always truncate subject to 100 characters max
- Fixes issue where selecting all templates created too-long subject
- Truncate req.emailSubject to 100 characters max as required by Docusign
- Add '...' suffix when truncating long subjects
- Add test case for subject truncation validation
- Fixes error: 'email subject must be no greater than 100 characters'
- Truncate envelopeSubject to 100 characters max as required by Docusign
- Add '...' suffix when truncating long subjects
- Add test case for subject truncation validation
- Fixes error: 'email subject must be no greater than 100 characters'
- Truncate envelopeSubject to 100 characters max as required by Docusign
- Add '...' suffix when truncating long subjects
- Add test case for subject truncation validation
- Fixes error: 'email subject must be no greater than 100 characters'
- Email subject is now combined document names (Short_Name__c if available)
- Email body is concatenated dfsle_EmailMessage__c from each selected template
- No longer uses template-level email subject for envelope
- Keeps status/document name logic unchanged
Priority: Short_Name__c > stripped Name > template ID
Requires adding Short_Name__c (Text 80) custom field to
dfsle__EnvelopeConfiguration__c. Falls back to language-stripped
Name if Short_Name__c is blank or not populated.
- First document label is now all template names joined with ', '
- Strips ' - English', ' - Spanish', ' - French' suffixes (case-insensitive)
- Truncates to 255 chars with '...' if too long
- Docusign Status now shows e.g. 'Admin Unit Notification, Consent to Eval'
instead of 'Template 89dd5ead'
Query dfsle__EnvelopeConfiguration__c to get template names and pass
them as document labels to dfsle.Document.fromTemplate(). This makes
the Docusign Status screen show meaningful names like 'Consent to Eval'
instead of 'Template 89dd5ead'.
- Queries Client_Case__c for Service_Coordinator__c and Docusign_Recipient_1__c
- Resolves Contact/User name and email from lookup targets
- Maps recipients to Docusign template roles: 'Service Coordinator' and 'Docusign Recipient #1'
- Validates recipients exist and have email addresses
- Supports both Contact and User lookup types
- Role names and field names are configurable constants at top of class
- Clear error messages if recipients are missing or have no email
BREAKING CHANGE: Now uses dfsle managed package for Docusign integration.
No separate credentials or Named Credentials needed.
Changes:
- Rewrote DocusignCompositeEnvelopeBuilder to use dfsle.EnvelopeService
and dfsle.Document.fromTemplate() for composite envelopes
- Simplified DocusignEnvelopeRequestHandler to validation-only
- Updated all tests to use dfsle.TestUtils.setMock()
- 12 comprehensive test methods (success, validation, edge cases)
Deleted (no longer needed):
- DocusignAPIService.cls (raw HTTP callouts)
- DocusignAPIServiceTest.cls
- DocusignCredentials.cls (custom settings)
- DocusignCredentialsTest.cls
Benefits:
- Uses existing dfsle package authentication automatically
- No Named Credential or Custom Setting setup required
- ~95 lines of code vs ~380 lines before
- Fully supported by Docusign managed package
- Created DocusignEnvelopeRequest.cls (separate global class for input)
- Created DocusignEnvelopeResult.cls (separate global class for output)
- Updated DocusignCompositeEnvelopeBuilder to use standalone classes
- Updated DocusignEnvelopeRequestHandler to reference standalone classes
- Updated all test classes to use new class references
- Fixes Flow Builder visibility issues with nested inner classes
- Better API design with clear input/output types
- Easier to extend and reuse across other classes
Changes:
- Move validation logic to DocusignEnvelopeRequestHandler.validateRequest()
- Move envelope JSON building to DocusignEnvelopeRequestHandler.buildEnvelopeJSON()
- Add comprehensive test suite for handler (10 test methods)
- Simplify main invocable method - focus on orchestration
- Add DEPLOYMENT_AND_TESTING.md reference guide with all CLI commands
- Handler is reusable for future enhancements and integrations
Benefits:
- Single Responsibility Principle
- Reusable handler for other classes
- Better testability
- Clean separation of concerns