When the primary recipient (Docusign Recipient #1) has no email address, the
envelope is created in draft status and the sender completes delivery manually
in the Docusign Sender View web console where they can configure SMS delivery.
Apex changes:
- DocusignCompositeEnvelopeBuilder: new DRAFT_PLACEHOLDER_EMAIL constant; when
requiresDraftMode=true calls sendEnvelope(envelope, false) to create a draft,
then builds and returns a Sender View URL via buildSenderViewUrl(); buildRecipient
accepts allowPlaceholderEmail flag and substitutes placeholder when email is blank
- DocusignEnvelopeRequest: new requiresDraftMode Boolean InvocableVariable
- DocusignEnvelopeResult: new senderViewUrl String InvocableVariable
Flow (V3) changes:
- Get_Records now fetches Docusign_Recipient_1__c
- New Get_Recipient_Contact lookup queries Contact.Email and Name
- New Is_Recipient_Email_Blank decision routes to Set_Draft_Mode when blank
- New Set_Draft_Mode assignment sets requiresDraftMode=true
- New No_Email_Warning_Screen explains the draft process and required steps
- requiresDraftMode passed as input; senderViewUrl captured as output
- New Is_Draft_Envelope decision routes to Sender_View_Screen or Success_Screen
- New Sender_View_Screen shows clickable link, placeholder email, and step-by-step
instructions for configuring SMS delivery in the Docusign web console
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
- 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