批量发送给多个收件人 docusign php

Bulk sending to multiple recipients docusign php

早上好,我正在尝试将文档发送给多个收件人,但它只发送给一个收件人,而且没有产生任何错误!

$signers = [];
    # Create the signer recipient model
    $signer1 = new \DocuSign\eSign\Model\Signer([
        'email' => $this->email_signatario, 'name' => $this->nome_signatario,
        'recipient_id' => "1", 'routing_order' => "5"]);

    array_push( $signers, $signer1 );

    $routing_order_count = 6;

    foreach ( $this->emails_adicionais as $endereco_adicional ) {
      $signer = new \DocuSign\eSign\Model\Signer([
        'email' => $endereco_adicional, 'name' => $this->nome_signatario . "_$routing_order_count",
        'recipient_id' => $routing_order_count, 'routing_order' => $routing_order_count]);

        array_push( $signers, $signer );
        $routing_order_count++;
    }$sign_here1 =  new \DocuSign\eSign\Model\SignHere([
        'anchor_string' => '*signature_1*', 'anchor_units' => 'pixels',
        'anchor_y_offset' => '10', 'anchor_x_offset' => '20']);
    $sign_here2 =  new \DocuSign\eSign\Model\SignHere([
        'anchor_string' => '/sn1/', 'anchor_units' =>  'pixels',
        'anchor_y_offset' => '10', 'anchor_x_offset' => '20']);

    # Add the tabs model (including the sign_here tabs) to the signer
    # The Tabs object wants arrays of the different field/tab types
    foreach ( $signers as $signer ) {
      $signer->setTabs( new \DocuSign\eSign\Model\Tabs([
        'sign_here_tabs' => [$sign_here1, $sign_here2]]));
    }



    # Add the recipients to the envelope object
    $recipients =  new \DocuSign\eSign\Model\Recipients([
        'signers' => $signers, 'recipient_count' => count( $signers ), 'carbon_copies' => [$cc1,$cc2,$cc3,$cc4]]);
    $envelope_definition->setRecipients($recipients);

这是我用来添加签名者和副本的代码。

谁有多次投稿的例子,麻烦发下,谢谢!

你有这个代码:

$routing_order_count++;

因此您正在生成路由顺序为 1、2、3、4 等的收件人。

第一个马上就能拿到,第二个只有第一个签名完成后才能拿到

所以你看到的是预期的。

如果您希望他们同时全部获取 - 将其更改为:

$routing_order_count = 1