I am trying to create the multiple document and I am getting the complete document in the envelop_definition array but when it will generate the docusign envelope then it is showing only first one.
What do I need to do it?
I am using below code for multiple documents.
$docs = array();
$b=1;
foreach ($fileArray as $key => $file) {
// Add a document to the envelope
$document = new DocuSign\eSign\Model\Document();
$document->setDocumentBase64(base64_encode(file_get_contents($file)));
$document->setName('Document '.$b);
$document->setDocumentId($b);
$document->setOrder($b);
$docs[] = $document;
# code...
$b++;
}
$envelop_definition->setDocuments($docs);
$envelop_definition->setTemplateRoles($all_template_roles);
// send notification about status change
$envelop_definition->setEventNotification($event_notification);
// set envelope status to "sent" to immediately send the signature request
$envelop_definition->setStatus("sent");
$envelopeApi->createEnvelope($accountId, $envelop_definition, $options);
but getting only first document.