feat(sms): SMS delivery via dfsle withSmsDelivery() for recipients without email

- 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
This commit is contained in:
Paul Huliganga 2026-03-13 09:57:28 -04:00
parent 86e7d2fb62
commit e41e43cabd
3 changed files with 821 additions and 15 deletions

View File

@ -28,6 +28,17 @@ global with sharing class DocusignCompositeEnvelopeBuilder {
// ============================================================ // ============================================================
@TestVisible @TestVisible
private static final String MULTI_COPY_TEMPLATE_NAME = 'Authorization to Release Information'; private static final String MULTI_COPY_TEMPLATE_NAME = 'Authorization to Release Information';
// ============================================================
// SMS DELIVERY: Placeholder email used when the primary recipient
// (Docusign Recipient #1) has no email address and SMS delivery is
// requested via recipientSmsPhone. Docusign requires an email on
// every recipient even when dfsle.Recipient.withSmsDelivery() is used;
// this placeholder satisfies that requirement without routing any
// actual email — delivery occurs entirely via SMS.
// ============================================================
@TestVisible
private static final String SMS_PLACEHOLDER_EMAIL = 'placeholder_email@docusign.com';
@InvocableMethod( @InvocableMethod(
label='Send Composite Docusign Envelope' label='Send Composite Docusign Envelope'
@ -188,7 +199,7 @@ global with sharing class DocusignCompositeEnvelopeBuilder {
} }
// Resolve recipients from Client_Case__c lookup fields // Resolve recipients from Client_Case__c lookup fields
List<dfsle.Recipient> recipients = resolveRecipients(req.recordId); List<dfsle.Recipient> recipients = resolveRecipients(req.recordId, req.recipientSmsPhone);
myEnvelope = myEnvelope.withRecipients(recipients); myEnvelope = myEnvelope.withRecipients(recipients);
// Set envelope subject to combined display names (deduplicated, with copy counts). // Set envelope subject to combined display names (deduplicated, with copy counts).
@ -256,9 +267,13 @@ global with sharing class DocusignCompositeEnvelopeBuilder {
* @description Resolves recipients from Client_Case__c lookup fields. * @description Resolves recipients from Client_Case__c lookup fields.
* Queries the case record and related contacts to get name/email. * Queries the case record and related contacts to get name/email.
* @param recordId The Client_Case__c record ID * @param recordId The Client_Case__c record ID
* @param smsPhone Optional SMS phone for the primary recipient. When provided,
* the Docusign Recipient #1 is configured for SMS delivery via
* dfsle.Recipient.withSmsDelivery() and a placeholder email is
* substituted if the recipient has no email address.
* @return List of dfsle.Recipient objects with role mappings * @return List of dfsle.Recipient objects with role mappings
*/ */
private static List<dfsle.Recipient> resolveRecipients(String recordId) { private static List<dfsle.Recipient> resolveRecipients(String recordId, String smsPhone) {
// Query the Client_Case__c record with recipient lookup fields // Query the Client_Case__c record with recipient lookup fields
// NOTE: Adjust field API names if they differ in your org // NOTE: Adjust field API names if they differ in your org
String query = 'SELECT Id, ' String query = 'SELECT Id, '
@ -271,16 +286,16 @@ global with sharing class DocusignCompositeEnvelopeBuilder {
List<dfsle.Recipient> recipients = new List<dfsle.Recipient>(); List<dfsle.Recipient> recipients = new List<dfsle.Recipient>();
Integer routingOrder = 1; Integer routingOrder = 1;
// Recipient 1: Service Coordinator // Recipient 1: Service Coordinator (always email delivery)
Id serviceCoordinatorId = (Id) caseRecord.get(FIELD_SERVICE_COORDINATOR); Id serviceCoordinatorId = (Id) caseRecord.get(FIELD_SERVICE_COORDINATOR);
if (serviceCoordinatorId != null) { if (serviceCoordinatorId != null) {
recipients.add(buildRecipient(serviceCoordinatorId, ROLE_SERVICE_COORDINATOR, routingOrder++, recordId)); recipients.add(buildRecipient(serviceCoordinatorId, ROLE_SERVICE_COORDINATOR, routingOrder++, recordId, null));
} }
// Recipient 2: Docusign Recipient #1 // Recipient 2: Docusign Recipient #1 (SMS delivery when smsPhone is provided)
Id docusignRecipientId = (Id) caseRecord.get(FIELD_DOCUSIGN_RECIPIENT); Id docusignRecipientId = (Id) caseRecord.get(FIELD_DOCUSIGN_RECIPIENT);
if (docusignRecipientId != null) { if (docusignRecipientId != null) {
recipients.add(buildRecipient(docusignRecipientId, ROLE_DOCUSIGN_RECIPIENT, routingOrder++, recordId)); recipients.add(buildRecipient(docusignRecipientId, ROLE_DOCUSIGN_RECIPIENT, routingOrder++, recordId, smsPhone));
} }
if (recipients.isEmpty()) { if (recipients.isEmpty()) {
@ -292,14 +307,20 @@ global with sharing class DocusignCompositeEnvelopeBuilder {
} }
/** /**
* @description Builds a dfsle.Recipient from a Contact/User lookup ID * @description Builds a dfsle.Recipient from a Contact/User lookup ID.
* @param recipientId The Contact or User record ID * When smsPhone is provided the recipient is configured for SMS
* @param roleName The Docusign template role name * delivery via dfsle.Recipient.withSmsDelivery(). If the recipient
* @param routingOrder Signing order * has no email address and SMS delivery is requested, SMS_PLACEHOLDER_EMAIL
* is substituted Docusign requires an email field on every recipient
* even when delivery is via SMS.
* @param recipientId The Contact or User record ID
* @param roleName The Docusign template role name (must match exactly)
* @param routingOrder Signing order
* @param sourceRecordId The source Client_Case__c record ID * @param sourceRecordId The source Client_Case__c record ID
* @param smsPhone Optional phone number for SMS delivery. Null for email delivery.
* @return dfsle.Recipient configured for the role * @return dfsle.Recipient configured for the role
*/ */
private static dfsle.Recipient buildRecipient(Id recipientId, String roleName, Integer routingOrder, String sourceRecordId) { private static dfsle.Recipient buildRecipient(Id recipientId, String roleName, Integer routingOrder, String sourceRecordId, String smsPhone) {
// Determine if this is a Contact or User // Determine if this is a Contact or User
String objectType = recipientId.getSObjectType().getDescribe().getName(); String objectType = recipientId.getSObjectType().getDescribe().getName();
@ -320,17 +341,30 @@ global with sharing class DocusignCompositeEnvelopeBuilder {
} }
if (String.isBlank(recipientEmail)) { if (String.isBlank(recipientEmail)) {
throw new IllegalArgumentException('No email found for ' + roleName + ' (' + recipientName + '). ' if (String.isNotBlank(smsPhone)) {
+ 'Please ensure the recipient has a valid email address.'); // SMS delivery requested — substitute placeholder email so the dfsle
// Toolkit can create the recipient. Actual delivery is via SMS only.
recipientEmail = SMS_PLACEHOLDER_EMAIL;
} else {
throw new IllegalArgumentException('No email found for ' + roleName + ' (' + recipientName + '). '
+ 'Please ensure the recipient has a valid email address.');
}
} }
return dfsle.Recipient.fromSource( dfsle.Recipient recipient = dfsle.Recipient.fromSource(
recipientName, recipientName,
recipientEmail, recipientEmail,
null, // phone (optional) null, // phone (not used — SMS delivery set below)
roleName, // must match template role exactly roleName, // must match template role exactly
new dfsle.Entity(sourceRecordId) // source record for merge fields new dfsle.Entity(sourceRecordId) // source record for merge fields
); );
// Enable SMS delivery when a phone number is provided
if (String.isNotBlank(smsPhone)) {
recipient = recipient.withSmsDelivery(smsPhone);
}
return recipient;
} }
private static void logResult(Integer templateCount, String envelopeId, String status, String errorMessage) { private static void logResult(Integer templateCount, String envelopeId, String status, String errorMessage) {

View File

@ -39,4 +39,11 @@ global class DocusignEnvelopeRequest {
required=false required=false
) )
global Integer authReleaseFormCopies; global Integer authReleaseFormCopies;
@InvocableVariable(
label='Recipient SMS Phone'
description='Mobile phone number for SMS delivery when the primary recipient (Docusign Recipient #1) has no email address. Uses dfsle Recipient.withSmsDelivery(). A placeholder email is substituted automatically so the envelope can be created. Format: +15551234567 (E.164 preferred).'
required=false
)
global String recipientSmsPhone;
} }

View File

@ -0,0 +1,765 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<actionCalls>
<name>Send_Composite_Envelope</name>
<label>Send Composite Envelope</label>
<locationX>182</locationX>
<locationY>1082</locationY>
<actionName>DocusignCompositeEnvelopeBuilder</actionName>
<actionType>apex</actionType>
<connector>
<targetReference>Check_Envelope_Result</targetReference>
</connector>
<flowTransactionModel>Automatic</flowTransactionModel>
<inputParameters>
<name>templateIds</name>
<value>
<elementReference>compositeTemplateIds</elementReference>
</value>
</inputParameters>
<inputParameters>
<name>recordId</name>
<value>
<elementReference>recordId</elementReference>
</value>
</inputParameters>
<inputParameters>
<name>language</name>
<value>
<elementReference>Get_Records.Docusign_Envelope_Language__c</elementReference>
</value>
</inputParameters>
<inputParameters>
<name>authReleaseFormCopies</name>
<value>
<elementReference>authReleaseFormCopies</elementReference>
</value>
</inputParameters>
<inputParameters>
<name>recipientSmsPhone</name>
<value>
<elementReference>recipientSmsPhone</elementReference>
</value>
</inputParameters>
<nameSegment>DocusignCompositeEnvelopeBuilder</nameSegment>
<offset>0</offset>
<outputParameters>
<assignToReference>envelopeId</assignToReference>
<name>envelopeId</name>
</outputParameters>
<outputParameters>
<assignToReference>envelopeSuccess</assignToReference>
<name>success</name>
</outputParameters>
<outputParameters>
<assignToReference>envelopeErrorMessage</assignToReference>
<name>errorMessage</name>
</outputParameters>
</actionCalls>
<apiVersion>60.0</apiVersion>
<areMetricsLoggedToDataCloud>false</areMetricsLoggedToDataCloud>
<assignments>
<name>Add_Template_ID</name>
<label>Add Template ID</label>
<locationX>270</locationX>
<locationY>1106</locationY>
<assignmentItems>
<assignToReference>compositeTemplateIds</assignToReference>
<operator>Add</operator>
<value>
<elementReference>Build_Template_ID_Collection.dfsle__DocuSignId__c</elementReference>
</value>
</assignmentItems>
<connector>
<targetReference>Build_Template_ID_Collection</targetReference>
</connector>
</assignments>
<assignments>
<name>Flag_Auth_Release_Selected</name>
<label>Flag Authorization to Release Template Selected</label>
<locationX>270</locationX>
<locationY>1000</locationY>
<assignmentItems>
<assignToReference>authReleaseTemplateSelected</assignToReference>
<operator>Assign</operator>
<value>
<booleanValue>true</booleanValue>
</value>
</assignmentItems>
<connector>
<targetReference>Scan_For_Auth_Release_Template</targetReference>
</connector>
</assignments>
<assignments>
<name>Store_Auth_Release_Copies</name>
<label>Store Authorization to Release Copies Selection</label>
<locationX>182</locationX>
<locationY>1160</locationY>
<assignmentItems>
<assignToReference>authReleaseFormCopies</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>authReleaseFormCopies_Radio</elementReference>
</value>
</assignmentItems>
<connector>
<targetReference>Build_Template_ID_Collection</targetReference>
</connector>
</assignments>
<decisions>
<name>Check_Envelope_Result</name>
<label>Check Envelope Result</label>
<locationX>182</locationX>
<locationY>1190</locationY>
<defaultConnector>
<targetReference>Error_Screen</targetReference>
</defaultConnector>
<defaultConnectorLabel>Default Outcome</defaultConnectorLabel>
<rules>
<name>Envelope_Sent_Successfully</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>envelopeSuccess</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<booleanValue>true</booleanValue>
</rightValue>
</conditions>
<connector>
<targetReference>Success_Screen</targetReference>
</connector>
<label>Envelope Sent Successfully</label>
</rules>
</decisions>
<decisions>
<name>Check_Row_Selection</name>
<label>Check Row Selection</label>
<locationX>380</locationX>
<locationY>674</locationY>
<defaultConnector>
<targetReference>Row_not_selected</targetReference>
</defaultConnector>
<defaultConnectorLabel>Default Outcome</defaultConnectorLabel>
<rules>
<name>Is_Row_Selected</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>data.firstSelectedRow.Id</leftValueReference>
<operator>IsNull</operator>
<rightValue>
<booleanValue>false</booleanValue>
</rightValue>
</conditions>
<connector>
<targetReference>Scan_For_Auth_Release_Template</targetReference>
</connector>
<label>Is Row Selected?</label>
</rules>
</decisions>
<decisions>
<name>Is_Auth_Release_Selected</name>
<label>Is Authorization to Release Info Selected?</label>
<locationX>380</locationX>
<locationY>890</locationY>
<defaultConnector>
<targetReference>Build_Template_ID_Collection</targetReference>
</defaultConnector>
<defaultConnectorLabel>No - Proceed</defaultConnectorLabel>
<rules>
<name>Auth_Release_Template_Found</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>authReleaseTemplateSelected</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<booleanValue>true</booleanValue>
</rightValue>
</conditions>
<connector>
<targetReference>Authorization_Copies_Screen</targetReference>
</connector>
<label>Yes - Ask for copies</label>
</rules>
</decisions>
<decisions>
<name>Is_Language_Selected</name>
<label>Is Language Selected?</label>
<locationX>611</locationX>
<locationY>458</locationY>
<defaultConnector>
<targetReference>Language_Not_Added_Screen</targetReference>
</defaultConnector>
<defaultConnectorLabel>Default Outcome</defaultConnectorLabel>
<rules>
<name>Language_Selected</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>Get_Records.Docusign_Envelope_Language__c</leftValueReference>
<operator>IsNull</operator>
<rightValue>
<booleanValue>false</booleanValue>
</rightValue>
</conditions>
<connector>
<targetReference>Language_Warning_Screen</targetReference>
</connector>
<label>Language Selected?</label>
</rules>
</decisions>
<decisions>
<name>Does_Row_Contain_Auth_Release</name>
<label>Does This Row Contain Authorization to Release Info?</label>
<locationX>270</locationX>
<locationY>890</locationY>
<defaultConnector>
<targetReference>Scan_For_Auth_Release_Template</targetReference>
</defaultConnector>
<defaultConnectorLabel>No</defaultConnectorLabel>
<rules>
<name>Row_Is_Auth_Release_Template</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>Scan_For_Auth_Release_Template.Name</leftValueReference>
<operator>Contains</operator>
<rightValue>
<stringValue>Authorization to Release Information</stringValue>
</rightValue>
</conditions>
<connector>
<targetReference>Flag_Auth_Release_Selected</targetReference>
</connector>
<label>Yes</label>
</rules>
</decisions>
<recordLookups>
<name>Get_Recipient_Contact</name>
<label>Get Recipient Contact</label>
<locationX>611</locationX>
<locationY>242</locationY>
<assignNullValuesIfNoRecordsFound>true</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Is_Recipient_Email_Blank</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>Get_Records.Docusign_Recipient_1__c</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Contact</object>
<queriedFields>Id</queriedFields>
<queriedFields>Email</queriedFields>
<queriedFields>Name</queriedFields>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<decisions>
<name>Is_Recipient_Email_Blank</name>
<label>Is Recipient Email Blank?</label>
<locationX>611</locationX>
<locationY>350</locationY>
<defaultConnector>
<targetReference>Is_Language_Selected</targetReference>
</defaultConnector>
<defaultConnectorLabel>Has Email - Continue</defaultConnectorLabel>
<rules>
<name>Recipient_Has_No_Email</name>
<conditionLogic>or</conditionLogic>
<conditions>
<leftValueReference>Get_Recipient_Contact.Email</leftValueReference>
<operator>IsNull</operator>
<rightValue>
<booleanValue>true</booleanValue>
</rightValue>
</conditions>
<conditions>
<leftValueReference>Get_Recipient_Contact.Email</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<stringValue></stringValue>
</rightValue>
</conditions>
<connector>
<targetReference>SMS_Phone_Screen</targetReference>
</connector>
<label>No Email - Collect SMS Phone</label>
</rules>
</decisions>
<screens>
<name>SMS_Phone_Screen</name>
<label>Recipient Mobile Phone for SMS Delivery</label>
<locationX>842</locationX>
<locationY>458</locationY>
<allowBack>false</allowBack>
<allowFinish>true</allowFinish>
<allowPause>false</allowPause>
<connector>
<targetReference>Is_Language_Selected</targetReference>
</connector>
<fields>
<name>SMS_Instructions_Text</name>
<fieldText>&lt;p&gt;The selected recipient ({!Get_Recipient_Contact.Name}) does not have an email address on file. The envelope will be delivered via &lt;strong&gt;SMS text message&lt;/strong&gt; instead.&lt;/p&gt;&lt;p&gt;Please enter the recipient&amp;apos;s mobile phone number in E.164 format (e.g. &lt;strong&gt;+15551234567&lt;/strong&gt;).&lt;/p&gt;</fieldText>
<fieldType>DisplayText</fieldType>
</fields>
<fields>
<name>recipientSmsPhone_Input</name>
<dataType>String</dataType>
<fieldText>Recipient Mobile Phone Number</fieldText>
<fieldType>InputField</fieldType>
<isRequired>true</isRequired>
<outputParameters>
<assignToReference>recipientSmsPhone</assignToReference>
<name>value</name>
</outputParameters>
<scale>0</scale>
</fields>
<nextOrFinishButtonLabel>Next</nextOrFinishButtonLabel>
<showFooter>true</showFooter>
<showHeader>true</showHeader>
</screens>
<environments>Default</environments>
<interviewLabel>Docusign Envelope Templates V4 {!$Flow.CurrentDateTime}</interviewLabel>
<label>Docusign Envelope Templates V4</label>
<loops>
<name>Build_Template_ID_Collection</name>
<label>Build Template ID Collection</label>
<locationX>182</locationX>
<locationY>1214</locationY>
<collectionReference>data.selectedRows</collectionReference>
<iterationOrder>Asc</iterationOrder>
<nextValueConnector>
<targetReference>Add_Template_ID</targetReference>
</nextValueConnector>
<noMoreValuesConnector>
<targetReference>Send_Composite_Envelope</targetReference>
</noMoreValuesConnector>
</loops>
<loops>
<name>Scan_For_Auth_Release_Template</name>
<label>Scan For Authorization to Release Template</label>
<locationX>380</locationX>
<locationY>782</locationY>
<collectionReference>data.selectedRows</collectionReference>
<iterationOrder>Asc</iterationOrder>
<nextValueConnector>
<targetReference>Does_Row_Contain_Auth_Release</targetReference>
</nextValueConnector>
<noMoreValuesConnector>
<targetReference>Is_Auth_Release_Selected</targetReference>
</noMoreValuesConnector>
</loops>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>Flow</processType>
<recordLookups>
<name>DocuSign_Envelope_Templates</name>
<label>DocuSign Envelope Templates</label>
<locationX>380</locationX>
<locationY>458</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Envelope_template_records</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Envelope_Template_Language__c</field>
<operator>EqualTo</operator>
<value>
<elementReference>Get_Records.Docusign_Envelope_Language__c</elementReference>
</value>
</filters>
<filters>
<field>Short_Name__c</field>
<operator>IsNull</operator>
<value>
<booleanValue>false</booleanValue>
</value>
</filters>
<getFirstRecordOnly>false</getFirstRecordOnly>
<object>dfsle__EnvelopeConfiguration__c</object>
<queriedFields>Id</queriedFields>
<queriedFields>Name</queriedFields>
<queriedFields>dfsle__DocuSignId__c</queriedFields>
<sortField>Name</sortField>
<sortOrder>Asc</sortOrder>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>Get_Records</name>
<label>Get Records</label>
<locationX>611</locationX>
<locationY>134</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Get_Recipient_Contact</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>recordId</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Client_Case__c</object>
<queriedFields>Id</queriedFields>
<queriedFields>Docusign_Envelope_Language__c</queriedFields>
<queriedFields>Docusign_Recipient_1__c</queriedFields>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<screens>
<name>Envelope_template_records</name>
<label>Envelope template records</label>
<locationX>380</locationX>
<locationY>566</locationY>
<allowBack>true</allowBack>
<allowFinish>true</allowFinish>
<allowPause>false</allowPause>
<backButtonLabel>Back</backButtonLabel>
<connector>
<targetReference>Check_Row_Selection</targetReference>
</connector>
<fields>
<name>data</name>
<dataTypeMappings>
<typeName>T</typeName>
<typeValue>dfsle__EnvelopeConfiguration__c</typeValue>
</dataTypeMappings>
<extensionName>flowruntime:datatable</extensionName>
<fieldType>ComponentInstance</fieldType>
<inputParameters>
<name>label</name>
<value>
<stringValue>Select Templates for Composite Envelope</stringValue>
</value>
</inputParameters>
<inputParameters>
<name>selectionMode</name>
<value>
<stringValue>MULTI_SELECT</stringValue>
</value>
</inputParameters>
<inputParameters>
<name>minRowSelection</name>
<value>
<numberValue>0.0</numberValue>
</value>
</inputParameters>
<inputParameters>
<name>tableData</name>
<value>
<elementReference>DocuSign_Envelope_Templates</elementReference>
</value>
</inputParameters>
<inputParameters>
<name>columns</name>
<value>
<stringValue>[{&quot;apiName&quot;:&quot;Name&quot;,&quot;guid&quot;:&quot;column-6d57&quot;,&quot;editable&quot;:false,&quot;hasCustomHeaderLabel&quot;:true,&quot;customHeaderLabel&quot;:&quot;Envelope Template Name&quot;,&quot;wrapText&quot;:true,&quot;order&quot;:0,&quot;label&quot;:&quot;Name&quot;,&quot;type&quot;:&quot;text&quot;}]</stringValue>
</value>
</inputParameters>
<inputsOnNextNavToAssocScrn>UseStoredValues</inputsOnNextNavToAssocScrn>
<isRequired>true</isRequired>
<storeOutputAutomatically>true</storeOutputAutomatically>
<styleProperties>
<verticalAlignment>
<stringValue>top</stringValue>
</verticalAlignment>
<width>
<stringValue>12</stringValue>
</width>
</styleProperties>
</fields>
<nextOrFinishButtonLabel>Send</nextOrFinishButtonLabel>
<showFooter>true</showFooter>
<showHeader>true</showHeader>
</screens>
<screens>
<name>Authorization_Copies_Screen</name>
<label>Authorization to Release Info - Number of Copies</label>
<locationX>182</locationX>
<locationY>1106</locationY>
<allowBack>true</allowBack>
<allowFinish>true</allowFinish>
<allowPause>false</allowPause>
<backButtonLabel>Back</backButtonLabel>
<connector>
<targetReference>Store_Auth_Release_Copies</targetReference>
</connector>
<fields>
<name>AuthCopiesHeader</name>
<fieldText>&lt;p&gt;The &lt;strong&gt;Authorization to Release Information&lt;/strong&gt; form was selected.&lt;/p&gt;&lt;p&gt;How many copies of this form should be included in the envelope?&lt;/p&gt;</fieldText>
<fieldType>DisplayText</fieldType>
<styleProperties>
<verticalAlignment>
<stringValue>top</stringValue>
</verticalAlignment>
<width>
<stringValue>12</stringValue>
</width>
</styleProperties>
</fields>
<fields>
<name>authReleaseFormCopies_Radio</name>
<choiceReferences>AuthCopies_1</choiceReferences>
<choiceReferences>AuthCopies_2</choiceReferences>
<choiceReferences>AuthCopies_3</choiceReferences>
<dataType>Number</dataType>
<defaultSelectedChoiceReference>AuthCopies_1</defaultSelectedChoiceReference>
<fieldText>Number of Copies</fieldText>
<fieldType>RadioButtons</fieldType>
<isRequired>true</isRequired>
<scale>0</scale>
<styleProperties>
<verticalAlignment>
<stringValue>top</stringValue>
</verticalAlignment>
<width>
<stringValue>12</stringValue>
</width>
</styleProperties>
</fields>
<nextOrFinishButtonLabel>Next</nextOrFinishButtonLabel>
<showFooter>true</showFooter>
<showHeader>true</showHeader>
</screens>
<screens>
<name>Error_Screen</name>
<label>Error Screen</label>
<locationX>314</locationX>
<locationY>1298</locationY>
<allowBack>true</allowBack>
<allowFinish>true</allowFinish>
<allowPause>false</allowPause>
<backButtonLabel>Back</backButtonLabel>
<fields>
<name>ErrorDisplayMessage</name>
<fieldText>&lt;p&gt;&lt;span style=&quot;font-size: 16px; color: rgb(255, 0, 0);&quot;&gt;❌ Failed to send composite envelope.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Error:&lt;/strong&gt; {!envelopeErrorMessage}&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Please try again or contact your administrator.&lt;/p&gt;</fieldText>
<fieldType>DisplayText</fieldType>
<styleProperties>
<verticalAlignment>
<stringValue>top</stringValue>
</verticalAlignment>
<width>
<stringValue>12</stringValue>
</width>
</styleProperties>
</fields>
<showFooter>true</showFooter>
<showHeader>false</showHeader>
</screens>
<screens>
<name>Language_Not_Added_Screen</name>
<label>Language Not Added Screen</label>
<locationX>842</locationX>
<locationY>350</locationY>
<allowBack>false</allowBack>
<allowFinish>true</allowFinish>
<allowPause>false</allowPause>
<fields>
<name>LanguageNotSelected</name>
<fieldText>&lt;p&gt;The &lt;strong&gt;DocuSign Envelope Language&lt;/strong&gt; is not populated on the record. Please add the language first and then proceed.&lt;/p&gt;</fieldText>
<fieldType>DisplayText</fieldType>
<styleProperties>
<verticalAlignment>
<stringValue>top</stringValue>
</verticalAlignment>
<width>
<stringValue>12</stringValue>
</width>
</styleProperties>
</fields>
<showFooter>true</showFooter>
<showHeader>true</showHeader>
</screens>
<screens>
<name>Language_Warning_Screen</name>
<label>Language Warning Screen</label>
<locationX>380</locationX>
<locationY>350</locationY>
<allowBack>false</allowBack>
<allowFinish>true</allowFinish>
<allowPause>false</allowPause>
<connector>
<targetReference>DocuSign_Envelope_Templates</targetReference>
</connector>
<fields>
<name>LangWarningText</name>
<fieldText>&lt;p&gt;The current selected language is &lt;strong&gt;{!Get_Records.Docusign_Envelope_Language__c}. &lt;/strong&gt;On the next screen you will be able to see form names of {!Get_Records.Docusign_Envelope_Language__c} language only. If you want to switch the language, please go back to record and select another language form &lt;strong&gt;DocuSign Envelope Language&lt;/strong&gt;.&lt;/p&gt;</fieldText>
<fieldType>DisplayText</fieldType>
<styleProperties>
<verticalAlignment>
<stringValue>top</stringValue>
</verticalAlignment>
<width>
<stringValue>12</stringValue>
</width>
</styleProperties>
</fields>
<nextOrFinishButtonLabel>Next</nextOrFinishButtonLabel>
<showFooter>true</showFooter>
<showHeader>true</showHeader>
</screens>
<screens>
<name>Row_not_selected</name>
<label>Row not selected</label>
<locationX>578</locationX>
<locationY>782</locationY>
<allowBack>true</allowBack>
<allowFinish>true</allowFinish>
<allowPause>false</allowPause>
<backButtonLabel>Back</backButtonLabel>
<fields>
<name>ErrorMessage</name>
<fieldText>&lt;p&gt;&lt;strong style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68);&quot;&gt;&lt;em&gt;You have not selected any of the forms. Please go back and select the form first and then proceed.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;</fieldText>
<fieldType>DisplayText</fieldType>
<styleProperties>
<verticalAlignment>
<stringValue>top</stringValue>
</verticalAlignment>
<width>
<stringValue>12</stringValue>
</width>
</styleProperties>
</fields>
<showFooter>true</showFooter>
<showHeader>false</showHeader>
</screens>
<screens>
<name>Success_Screen</name>
<label>Success Screen</label>
<locationX>50</locationX>
<locationY>1298</locationY>
<allowBack>false</allowBack>
<allowFinish>true</allowFinish>
<allowPause>false</allowPause>
<fields>
<name>SuccessMessage</name>
<fieldText>&lt;p&gt;&lt;span style=&quot;font-size: 16px; color: rgb(0, 128, 0);&quot;&gt;✅ Composite envelope sent successfully!&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Envelope ID:&lt;/strong&gt; {!envelopeId}&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Templates combined:&lt;/strong&gt; All selected templates were merged into a single envelope.&lt;/p&gt;</fieldText>
<fieldType>DisplayText</fieldType>
<styleProperties>
<verticalAlignment>
<stringValue>top</stringValue>
</verticalAlignment>
<width>
<stringValue>12</stringValue>
</width>
</styleProperties>
</fields>
<showFooter>true</showFooter>
<showHeader>false</showHeader>
</screens>
<start>
<locationX>485</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Get_Records</targetReference>
</connector>
</start>
<status>Draft</status>
<variables>
<name>compositeTemplateIds</name>
<dataType>String</dataType>
<isCollection>true</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<name>envelopeErrorMessage</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<name>envelopeId</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<name>envelopeSuccess</name>
<dataType>Boolean</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<name>recordId</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>true</isInput>
<isOutput>false</isOutput>
</variables>
<variables>
<name>authReleaseFormCopies</name>
<dataType>Number</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<scale>0</scale>
<value>
<numberValue>1.0</numberValue>
</value>
</variables>
<variables>
<name>authReleaseTemplateSelected</name>
<dataType>Boolean</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
<value>
<booleanValue>false</booleanValue>
</value>
</variables>
<choices>
<name>AuthCopies_1</name>
<choiceText>1 copy</choiceText>
<dataType>Number</dataType>
<value>
<numberValue>1.0</numberValue>
</value>
</choices>
<choices>
<name>AuthCopies_2</name>
<choiceText>2 copies</choiceText>
<dataType>Number</dataType>
<value>
<numberValue>2.0</numberValue>
</value>
</choices>
<choices>
<name>AuthCopies_3</name>
<choiceText>3 copies</choiceText>
<dataType>Number</dataType>
<value>
<numberValue>3.0</numberValue>
</value>
</choices>
<variables>
<name>recipientSmsPhone</name>
<dataType>String</dataType>
<isCollection>false</isCollection>
<isInput>false</isInput>
<isOutput>false</isOutput>
</variables>
</Flow>