Commit Graph

3 Commits

Author SHA1 Message Date
Paul Huliganga ac6de33317 feat(sms): add SMS delivery for recipients without email via direct REST API
- New DocusignSmsEnvelopeService: bypasses dfsle Toolkit to POST composite
  envelope JSON directly to Docusign REST API; sets additionalNotifications
  with secondaryDeliveryMethod=SMS and phoneNumber on the primary recipient
- DocusignEnvelopeRequest: new recipientSmsPhone InvocableVariable (E.164)
- DocusignCompositeEnvelopeBuilder: routes to DocusignSmsEnvelopeService when
  recipientSmsPhone is present; adds SMS_FALLBACK_EMAIL constant; buildRecipient
  substitutes placeholder email for no-email primary recipients in SMS path
- Flow (V3): Get_Records now fetches Docusign_Recipient_1__c; new
  Get_Recipient_Contact lookup checks Contact.Email; Is_Recipient_Email_Blank
  decision routes to SMS_Required_Screen when email is absent; phone number
  collected via required text input and passed as recipientSmsPhone to Apex
2026-03-12 23:48:17 -04:00
Paul Huliganga 9b355b997e feat(apex): support multiple copies of Authorization to Release Information
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
2026-03-11 16:23:51 -04:00
Paul Huliganga 7df62e06ca refactor: extract Request and Result as standalone global classes
- 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
2026-02-25 10:05:36 -05:00