@@ -37,25 +37,28 @@ public static function setTemplateTabValues(array $args, $clientService): array
37
37
38
38
public static function sendEnvelopeFromCreatedTemplate ($ clientService , $ args , $ envelope_definition ): array
39
39
{
40
- # 2. call Envelopes::create API method
40
+ # Step 4 start
41
+ # Call Envelopes::create API method
41
42
# Exceptions will be caught by the calling function
42
43
$ envelope_api = $ clientService ->getEnvelopeApi ();
43
44
$ envelopeResponse = $ envelope_api ->createEnvelope ($ args ['account_id ' ], $ envelope_definition );
44
45
$ envelope_id = $ envelopeResponse ->getEnvelopeId ();
45
-
46
- # 3. Create the Recipient View request object
47
- $ authentication_method = 'None ' ; # How is this application authenticating
48
- # the signer? See the `authentication_method' definition
49
- # https://developers.docusign.com/esign-rest-api/reference/Envelopes/EnvelopeViews/createRecipient
50
- $ recipient_view_request = $ clientService ->getRecipientViewRequest (
51
- $ authentication_method ,
52
- $ args ["envelope_args " ]
53
- );
54
-
55
- # 4. Obtain the recipient_view_url for the embedded signing
56
- # Exceptions will be caught by the calling function
57
- $ recipientView = $ clientService ->getRecipientView ($ args ['account_id ' ], $ envelope_id , $ recipient_view_request );
58
-
46
+ # Step 4 end
47
+
48
+ # Step 5 start
49
+ # Create the Recipient View request object
50
+ $ authentication_method = 'None ' ; # How is this application authenticating
51
+ # the signer? See the `authentication_method' definition
52
+ # https://developers.docusign.com/esign-rest-api/reference/Envelopes/EnvelopeViews/createRecipient
53
+ $ recipient_view_request = $ clientService ->getRecipientViewRequest (
54
+ $ authentication_method ,
55
+ $ args ["envelope_args " ]
56
+ );
57
+
58
+ # Obtain the recipient_view_url for the embedded signing
59
+ # Exceptions will be caught by the calling function
60
+ $ recipientView = $ clientService ->getRecipientView ($ args ['account_id ' ], $ envelope_id , $ recipient_view_request );
61
+ # Step 5 end
59
62
return ['envelope_id ' => $ envelope_id , 'redirect_url ' => $ recipientView ['url ' ]];
60
63
}
61
64
0 commit comments