【问题标题】:createEnvelope class create only first Docusign document not otherscreateEnvelope 类只创建第一个 Docusign 文档而不是其他文档
【发布时间】:2018-11-29 20:47:51
【问题描述】:

我正在尝试创建多个文档,并且我在 envelop_definition 数组中获取了完整的文档,但是当它生成文档信封时,它只显示第一个。

我需要做什么?

我将以下代码用于多个文档。

$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);

但只获得第一个文档。

【问题讨论】:

标签: php docusignapi docusigncompositetmplts


【解决方案1】:

您使用templateRoles 对象意味着您正在尝试创建一个使用已创建模板的信封。

如果是这种情况,则不要使用 Document 模型将文档添加到信封/模板中。

相反,您将文档和模板中的文档组合在一起。

如果您要将文档添加到模板中已有的文档集中,请参阅eg013AddDocToTemplate.sh 以获取代码示例。该示例也可在multiple languages 中找到。 PHP 正在生产中。

如果您要用新文档替换模板中已有的文档,请参阅answer

【讨论】:

    猜你喜欢
    • 2019-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-16
    • 1970-01-01
    • 2016-06-28
    • 2011-12-07
    相关资源
    最近更新 更多